Live demo - Slides - Apollo-client part
This demo app creates a MongoDB collection, exposes it via a GraphQL endpoint, and also creates corresponding REST endpoints.
You will need to authenticate yourself by filling GraphQL Playground's HTTP headers:
{
"device_id": "test"
}
yarn
USE_DISTANT_DB=true DB_USER=demo-apollo-server DB_PASSWORD=apollo yarn start
open http://localhost:3000/graphql
Connect to this local URL for a pre-filled query.
Note: You must identicate yourself with a device_id (passed via headers). E.g.
{
"device_id": "Test"
}
You need to install mongodb
on your machine first.
yarn
mongod
yarn start
open http://localhost:3000/graphql
Connect to this local URL for a pre-filled query.
Note: You must identicate yourself with a device_id (passed via headers). E.g.
{
"device_id": "Test"
}
- GET /api/cocktails
- GET /api/liked-cocktails
- GET /api/bookmarked-cocktails
- GET /api/cocktail/:id
- POST /api/toggle-like-cocktail?id=xxx
- POST /api/toggle-bookmark-cocktail?id=xxx
Thanks to TheCocktailDB for the data!