Table of Contents
Add type, query and schema for graphql
Now we need to add a type for Speaker, also a query and a schema for GraphQL.
We need to then add a root query in
And include the query in the schema.
Querying the endpoint
A JSON response like the below will be obtained.
Now you have a GraphQL server up and running on sinatra, and you can query the endpoint to get a list of speakers with the fields defined in the GraphQL query.
In the next part we will add mutations.