Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
});
};