Boilerplate for a scalable, production-ready GraphQL Gateway server
- Logging
- Custom GraphQL Schema composition using
graphql-delegate
- Stackable resolvers with
graphql-stack
- Scalable application architecture
- Authentication through JWT
- Before and after hooks for resolvers
... much more!
cd database
gc deploy
gc info # put the simple endpoint into the `GRAPHQL_ENDPOINT` env var in .envrc
gc root-token main # put the root token into the `ADMIN_TOKEN` env var in .envrc
yarn install
yarn start
# Open http://localhost:3000/playground
To seed some data, use gc playground
and execute the following mutation:
mutation {
createUser(
email: "[email protected]"
password: "abc"
posts: [{
title: "Post 0"
}]
friends: [{
email: "[email protected]"
password: "abc"
posts: [{
title: "Post 1"
}, {
title: "Post 2"
}, {
title: "Post 3"
}]
}]
) {
id
}
}
Now you can login with the created user against the gateway (http://localhost:3000/playground
):
mutation {
login(email: "[email protected]" password:"abc") {
token
}
}
With the token, you now can check the viewer
query:
{
viewer {
me {
id
}
friendsPosts {
id
}
}
}
We highly suggest you check out the code of the Gateway! The index.ts
is a good starting point.
Graphcool has a community of thousands of amazing developers and contributors. Welcome, please join us! ๐
Your feedback is very helpful, please share your opinion and thoughts!
If an existing feature request or bug report is very important for you, please go ahead and ๐ it or leave a comment. We're always open to reprioritize our roadmap to make sure you're having the best possible DX.
We love your ideas for new features. If you're missing a certain feature, please feel free to request a new feature here. (Please make sure to check first if somebody else already requested it.)