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 { 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
  • 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 { 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 } = require("apollo-server");
    const { ApolloServerPluginUsageReporting } = require("apollo-server-core");
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginUsageReporting({
          rewriteError(err) {
            // Using a more stable, known error property (e.g. `err.code`) would be
            // more defensive, however checking the `message` might serve most needs!
            if (err.message && err.message.startsWith("Known error message")) {
              return null;
            }
    
            // All other errors should still be reported!
            return err;
          }
        }),
      ],
    });
    Docs
  • const { ApolloServerPluginLandingPageDisabled } = require('apollo-server-core');
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginLandingPageDisabled()
      ]
    });
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples