Last active
March 17, 2021 21:40
-
-
Save carlosdiaz/4527d41e45f4ca9c0e40b94569964a33 to your computer and use it in GitHub Desktop.
TODOS GraphQL file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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