Skip to content
KeystoneJS LogoKeystoneJSv5

GraphQL App

A KeystoneJS App that creates a GraphQL API and GraphiQL playground.

The GraphiQL playground is disabled in production mode.

For information about writing queries and mutations for KeystoneJS see the Introduction to KeystoneJS' GraphQL API.

Usage

const { Keystone } = require('@keystonejs/keystone');
const { GraphQLApp } = require('@keystonejs/app-graphql');
const { AdminUIApp } = require('@keystonejs/app-admin-ui');

module.exports = {
  keystone: new Keystone(),
  apps: [
    new GraphQLApp({
      // All config keys are optional. Default values are shown here for completeness.
      apiPath: '/admin/api',
      graphiqlPath: '/admin/graphiql',
      schemaName: 'admin',
      apollo: {},
    }),
    new AdminUIApp(),
  ],
};

Config

OptionTypeDefaultDescription
apiPathString/admin/apiChange the API path
graphiqlPathString/admin/graphiqlChange the GraphiQL playground path
schemaNameStringadminChange the graphQL schema name (not recommended)
apolloObject{}Options passed directly to Apollo Server

Have you found a mistake, something that is missing, or could be improved on this page? Please edit the Markdown file on GitHub and submit a PR with your changes.

Edit Page