Updated ApolloServer configuration for introspection queries (#4660)

This commit is contained in:
Sleva 2019-12-06 12:35:06 +01:00 committed by Alexandre BODIN
parent 8e2a4cd1bf
commit 52f5770b06

View File

@ -83,6 +83,11 @@ module.exports = strapi => {
playground: false,
cors: false,
bodyParserConfig: true,
introspection: _.get(
strapi.plugins.graphql,
'config.introspection',
true
),
};
// Disable GraphQL Playground in production environment.
@ -92,10 +97,8 @@ module.exports = strapi => {
) {
serverParams.playground = {
endpoint: strapi.plugins.graphql.config.endpoint,
shareEnabled: strapi.plugins.graphql.config.shareEnabled
shareEnabled: strapi.plugins.graphql.config.shareEnabled,
};
serverParams.introspection = true;
}
const server = new ApolloServer(serverParams);