vue-fullstack-graphql icon indicating copy to clipboard operation
vue-fullstack-graphql copied to clipboard

Error in onboarding Instagram example

Open blackwood opened this issue 7 years ago • 2 comments

Node version: 8.4.0

GraphQL execution errors for query 'allPosts'

"Argument 'orderBy' expected type 'PostOrderBy' but got: createdAt_DESC. Reason: Enum value 'createdAt_DESC' is undefined in enum type 'PostOrderBy'. Known values are: description_ASC, description_DESC, id_ASC, id_DESC, imageUrl_ASC, imageUrl_DESC. (line 2, column 21):
  allPosts(orderBy: createdAt_DESC) {

blackwood avatar Oct 18 '17 15:10 blackwood

The problem is the way you are instructed to create a Post type. This is how it needs to be done:

type Post @model {
  id: @isUnique
  createdAt: DateTime!
  description: String!
  imageUrl: String!  
}

marktani avatar Oct 18 '17 15:10 marktani

Thanks, this worked for me when I modified the schema.

blackwood avatar Oct 18 '17 15:10 blackwood