GraphQL workshop
Introduction
The goal of the workshop is to create your own GraphQL-server that acts as a gateway on top of a few REST-services.
In this workshop we will be covering:
- Creating a Hello World GraphQL-app
- Proxying requests from existing REST-service
- Tying different data types in your REST-service together in a graph
Getting started
npm i
npm run dev
URLs
- http://localhost:8100 - GraphQL-server
- http://localhost:8101 - the existingg REST-server
Test query
Start by opening http://localhost:8100 (after npm run dev
) to see your GraphQL playground and get familiar with the project.
Try this query:
{
hello(name: "Harry")
}
Understand the existing Posts and Users data
- Posts - http://localhost:8101/posts?_limit=10
- Users - http://localhost:8101/users
Tasks
- Implement a Post resolver so we can query for our list of Posts.
- Implement a User resolver so we can query for all users.
- Implement User resolver inside Post to retrieve firstName and lastName.
- Add
limit
parameter to our Posts and Users query. - Add Ability to add users, posts using mutations.