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

  • import { ApolloServer } from "apollo-server";
    import { ApolloServerPluginLandingPageLocalDefault,
             ApolloServerPluginLandingPageProductionDefault
    } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        // Install a landing page plugin based on NODE_ENV
        process.env.NODE_ENV === 'production'
          ? ApolloServerPluginLandingPageProductionDefault({
              graphRef: "my-graph-id@my-graph-variant",
              footer: false,
            })
          : ApolloServerPluginLandingPageLocalDefault({ footer: false }),
      ],
    });
    Docs
  • const { ApolloServerPluginLandingPageDisabled } = require('apollo-server-core');
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginLandingPageDisabled()
      ]
    });
    Docs
  • const { ApolloServer } = require("apollo-server");
    const { ApolloServerPluginUsageReporting } = require("apollo-server-core");
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginUsageReporting({
          generateClientInfo: ({
            request
          }) => {
            const headers = request.http && request.http.headers;
            if(headers) {
              return {
                clientName: headers['apollographql-client-name'],
                clientVersion: headers['apollographql-client-version'],
              };
            } else {
              return {
                clientName: "Unknown Client",
                clientVersion: "Unversioned",
              };
            }
          },
        }),
      ],
    });
    
    server.listen().then(({ url }) => {
      console.log(`🚀  Server ready at ${url}`);
    });
    Docs
  • const { ApolloServerPluginLandingPageGraphQLPlayground } = require('apollo-server-core');
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginLandingPageGraphQLPlayground({
          // options
        })
      ]
    });
    Docs
  • import { ApolloServerPluginLandingPageGraphQLPlayground } from 'apollo-server-core';
    new ApolloServer({
      plugins: [
        ApolloServerPluginLandingPageGraphQLPlayground(playgroundOptions),
      ],
    });
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples