Skip to main content

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

  1. ๐Ÿ•ฐย  A get datetime query, and
  2. ๐Ÿ“ย  A ping-pong mutation
graphql/index.graphql
schema {
query: Query
mutation: Mutation
}

type Query {
getDateTime: String!
}

type Mutation {
pong(word: String!): String!
}