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!
}