GraphQL Schema Definition Language is an interface design language created in 2018.
#1336on PLDB | 6Years Old |
A type definition syntax to the GraphQL specification.
# Enumeration type for a level of priority
enum Priority {
LOW
MEDIUM
HIGH
}
# Our main todo type
type Todo {
id: ID!
name: String!
description: String
priority: Priority!
}
type Query {
# Get one todo item
todo(id: ID!): Todo
# Get all todo items
allTodos: [Todo!]!
}
type Mutation {
addTodo(name: String!, priority: Priority = LOW): Todo!
removeTodo(id: ID!): Todo!
}
schema {
query: Query
mutation: Mutation
}
Feature | Supported | Token | Example |
---|---|---|---|
Line Comments | โ | โโโ | โโโ A comment |
Comments | โ | ||
Semantic Indentation | X | ||
MultiLine Comments | X |