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 { ApolloServerPluginCacheControl } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginCacheControl({
          // Cache everything for 1 second by default.
          defaultMaxAge: 1000,
          // Don't send the `cache-control` response header.
          calculateHttpHeaders: false,
        }),
      ],
    });
    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 { ApolloServer, AuthenticationError } = require("apollo-server");
    const { ApolloServerPluginUsageReporting } = require("apollo-server-core");
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginUsageReporting({
          rewriteError(err) {
            // Return `null` to avoid reporting `AuthenticationError`s
            if (err instanceof AuthenticationError) {
              return null;
            }
    
            // All other errors will be reported.
            return err;
          }
        }),
      ],
    });
    Docs
  • const { ApolloServerPluginLandingPageDisabled } = require('apollo-server-core');
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginLandingPageDisabled()
      ]
    });
    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