How to use the apollo-server-core.ApolloServerBase function in apollo-server-core

To help you get started, we’ve selected a few apollo-server-core 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 codejie / fastify-apollo-step / lib / apollo-fastify.js View on Github external
'use strict'

const ApolloServerCore = require('apollo-server-core');

const graphql = require('./apollo-graphql');
const graphiql = require('./apollo-graphiql');

class ApolloServer extends ApolloServerCore.ApolloServerBase {

    constructor (opts) {
        const base = {
            context: opts.context,
            schema: opts.gqlSchema,
            typeDefs: opts.typeDefs,
            resolvers: opts.resolvers,
            schemaDirectives: opts.schemaDirectives,
            subscriptions: false,
            uploads: false,
        };

        if (opts.subscriptions && opts.subscriptions.enabled) {
            base.subscriptions = {
                path: opts.subscriptions.path,
                onConnect: opts.subscriptions.onConnect,