Skip to content

Instantly share code, notes, and snippets.

@carlosdiaz
Last active March 17, 2021 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosdiaz/4527d41e45f4ca9c0e40b94569964a33 to your computer and use it in GitHub Desktop.
Save carlosdiaz/4527d41e45f4ca9c0e40b94569964a33 to your computer and use it in GitHub Desktop.
TODOS GraphQL file
# we use a enum to define the possible values for categorizing the Priority for a TODO task
enum Priority {
HIGH
MEDIUM
LOW
}
# we define the Todos data structure, and we use the previous Priority definition
type Todos {
id: String!
name: String!
description: String!
priority: Priority!
}
# we define two ways of retrieving the information, it can be a list with full data or a query based on the name of the Todo
type Query {
todos: [Todos]!
todo(name: String): Todos
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment