8.2.1 • Published 5 years ago

@keystone-alpha/app-graphql v8.2.1

Weekly downloads
43
License
MIT
Repository
-
Last release
5 years ago

GraphQL App

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

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

Usage

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

module.exports = {
  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 Apollo GraphQL playground path
schemaNameStringadminChange the graphQL schema name (not recommended)
apolloObject{}Options passed directly to Apollo Server