Skip to content
KeystoneJS LogoKeystoneJS
👋🏻 Keystone 5 has officially moved to maintenance only. For the latest release of Keystone please visit the Keystone website.

GraphQL app

This is the last active development release of this package as Keystone 5 is now in a 6 to 12 month active maintenance phase. For more information please read our Keystone 5 and beyond post.

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

Note: 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

JS
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

Setting a custom schemaName

To use a custom schemaName, please ensure it is also passed in to the keystone constructor at initialization.

On this page

  • Usage
  • Config
  • Setting a custom schemaName
Edit on GitHub