GraphQL Yoga Server with Subscriptions
GraphQL Yoga from The Guild is a batteries-included cross-platform GraphQL over HTTP spec-compliant GraphQL server
powered by Envelop
and GraphQL Tools focused on easy setup, performance and great developer experience.
Example of Subscriptions.
To access GraphiQL - the GraphQL Playground - visit the /
route.
That's what you see in the preview pane below.
Configuration and Documentation
See the GraphQL Yoga documentation for configuration and all the bells and whistles.
For this example, we'll set to /
to make it easier to demo.
However, by default, the GraphQL route is configured to be on /graphql
which is more common.
const yoga =
createYoga({
schema,
})
You can set a custom endpoint:
const yoga =
createYoga({
schema,
graphqlEndpoint:
"/my-gql",
})
A landing page is shown be default whenever a 404 is hit.
You can disable it via the landingPage
option.
const yoga =
createYoga({
schema,
landingPage:
false
})