How to use the apollo-server-module-graphiql.renderGraphiQL function in apollo-server-module-graphiql

To help you get started, we’ve selected a few apollo-server-module-graphiql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github geek / graphi / lib / index.js View on Github external
internals.graphiqlHandler = function (request, h) {
  const { settings } = request.server.plugins.graphi;
  const query = request.query;
  const variables = query.variables || '{}';
  const prefix = request.route.realm.modifiers.route.prefix || '';

  return Graphiql.renderGraphiQL({
    endpointURL: prefix + settings.graphqlPath,
    query: query.query,
    variables: JSON.parse(variables),
    operationName: query.operationName
  });
};

apollo-server-module-graphiql

GraphiQL renderer for Apollo GraphQL Server

MIT
Latest version published 6 years ago

Package Health Score

75 / 100
Full package analysis