7.0.8 • Published 2 years ago
@itoa/app-graphql v7.0.8
GraphQL app
This is the last active development release of this package as Itoa 5 is now in a 6 to 12 month active maintenance phase. For more information please read our Itoa 5 and beyond post.
A ItoaJS 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 ItoaJS see the Introduction to ItoaJS' GraphQL API.
Usage
const { Itoa } = require('@itoa/itoa');
const { GraphQLApp } = require('@itoa/app-graphql');
const { AdminUIApp } = require('@itoa/app-admin-ui');
module.exports = {
itoa: new Itoa(),
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
Option | Type | Default | Description |
---|---|---|---|
apiPath | String | /admin/api | Change the API path |
graphiqlPath | String | /admin/graphiql | Change the GraphiQL playground path |
schemaName | String | admin | Change the graphQL schema name (not recommended) |
apollo | Object | {} | Options passed directly to Apollo Server |
Setting a custom schemaName
To use a custom schemaName
, please ensure it is also passed in to the itoa constructor at initialization.