How to use the apollo-server-hapi.graphqlHapi function in apollo-server-hapi

To help you get started, we’ve selected a few apollo-server-hapi 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 Codebrahma / gamification-platform-backend / plugins.js View on Github external
const appoloServer = require('apollo-server-hapi');

const executableSchema = require('./server/graphQL/executableSchema');

const DEVELOPMENT = 'development';

/**
 * exports array of plugins with configuration.
 * @type {Array}
 */
const plugins = [];

if (config.util.getEnv('NODE_ENV') === DEVELOPMENT) {
	// HAPI Graphql for HTTP endpoints
	plugins.push({
		plugin: appoloServer.graphqlHapi,
		options: {
			path: '/graphql',
			graphqlOptions: {
				schema: executableSchema,
			},
			route: {
				cors: true,
			},
		},
	});

	// graphiql interface
	plugins.push({
		plugin: appoloServer.graphiqlHapi,
		options: {
			path: '/graphiql',

apollo-server-hapi

Production-ready Node.js GraphQL server for Hapi

MIT
Latest version published 1 year ago

Package Health Score

65 / 100
Full package analysis