How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • const { ApolloServer } = require('apollo-server');
    const ApolloServerOperationRegistry =
      require('@apollo/server-plugin-operation-registry');
    
    /* This example doesn't provide `typeDefs` or `resolvers`,
       both of which are required to start the server. */
    const { typeDefs, resolvers } = require('./separatelyDefined');
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
    
      // You can import plugins or define them in-line, as shown:
      plugins: [
    
        /* This plugin is from a package that's imported above. */
        ApolloServerOperationRegistry({ /* options */ }),
    
        /* This plugin is imported in-place. */
        require('./localPluginModule'),
    
        /* This plugin is defined in-line. */
        {
          async serverWillStart() {
            console.log('Server starting up!');
          },
        }
      ],
    })
    Docs
  • import { ApolloServer } from "apollo-server";
    import {
      ApolloServerPluginLandingPageGraphQLPlayground
    } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginLandingPageGraphQLPlayground(),
      ],
    });
    Docs
  • import { ApolloServer } from 'apollo-server';
    
    async function startApolloServer(typeDefs, resolvers) {
      const server = new ApolloServer({ typeDefs, resolvers });
      const { url } = await server.listen();
      console.log(`🚀 Server ready at ${url}`);
    }
    Docs
  • import { ApolloServer } from "apollo-server";
    import { ApolloServerPluginCacheControlDisabled } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [ApolloServerPluginCacheControlDisabled()],
    });
    Docs
  • import { ApolloServer } from "apollo-server";
    import { ApolloServerPluginUsageReporting } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        // Sets a non-default option on the usage reporting plugin
        ApolloServerPluginUsageReporting({
          sendVariableValues: { all: true },
        }),
      ],
    });
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples