Define a GraphQL schema
mkdir graphql
touch graphql/index.graphql
Now, edit graphql/index.graphql
using your preferred editor. In this journey, we are going to add
- ๐ฐย A get datetime query, and
- ๐ย A ping-pong mutation
graphql/index.graphql
schema {
query: Query
mutation: Mutation
}
type Query {
getDateTime: String!
}
type Mutation {
pong(word: String!): String!
}