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 { ApolloServerPluginSchemaReporting } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginSchemaReporting(),
      ],
    });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">class</span> <span class="token class-name">ApolloServer</span> <span class="token keyword">import</span> ApolloServer</code></pre>
    Docs
    0
  • new ApolloServer({
      plugins: [
        ApolloServerPluginSchemaReporting({
          overrideReportedSchema: schema
        }),
        ApolloServerPluginUsageReporting({
          overrideReportedSchema: schema
        }),
      ],
    })
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  •     ApolloServerPluginUsageReporting({
          rewriteError(err) {
            // Make sure that a specific pattern is removed from all error messages.
            err.message = err.message.replace(/x-api-key:[A-Z0-9-]+/, "REDACTED");
            return err;
          }
        }),
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> ApolloServerPluginUsageReporting<span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>any</span><span class="token punctuation">></span></span><span class="token punctuation">(</span><span class="token parameter">options<span class="token operator">?</span><span class="token operator">:</span> apollo<span class="token operator">-</span>server<span class="token operator">-</span>core<span class="token punctuation">.</span>ApolloServerPluginUsageReportingOptions<span class="token operator">&lt;</span>any<span class="token operator">></span></span><span class="token punctuation">)</span> <span class="token operator">=></span> ApolloServerPlugin<span class="token operator">&lt;</span>BaseContext<span class="token operator">></span></code></pre>
    Docs
    0
  •     ApolloServerPluginUsageReporting({
          rewriteError(err) {
            // Return `null` to avoid reporting `AuthenticationError`s
            if (err instanceof AuthenticationError) {
              return null;
            }
    
            // All other errors will be reported.
            return err;
          }
        }),
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">const</span> ApolloServerPluginUsageReporting<span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>any</span><span class="token punctuation">></span></span><span class="token punctuation">(</span><span class="token parameter">options<span class="token operator">?</span><span class="token operator">:</span> apollo<span class="token operator">-</span>server<span class="token operator">-</span>core<span class="token punctuation">.</span>ApolloServerPluginUsageReportingOptions<span class="token operator">&lt;</span>any<span class="token operator">></span></span><span class="token punctuation">)</span> <span class="token operator">=></span> ApolloServerPlugin<span class="token operator">&lt;</span>BaseContext<span class="token operator">></span></code></pre>
    Docs
    0
  • 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 },
        }),
      ],
    });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">class</span> <span class="token class-name">ApolloServer</span> <span class="token keyword">import</span> ApolloServer</code></pre>
    Docs
    0
  • import { ApolloServer } from "apollo-server";
    import { ApolloServerPluginUsageReporting } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginUsageReporting({
          sendVariableValues: { all: true },
        }),
      ],
    });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">class</span> <span class="token class-name">ApolloServer</span> <span class="token keyword">import</span> ApolloServer</code></pre>
    Docs
    0
  • new ApolloServer({
      plugins: [
        ApolloServerPluginSchemaReporting({
          overrideReportedSchema: schema
        }),
        ApolloServerPluginUsageReporting({
          overrideReportedSchema: schema
        }),
      ],
    })
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token builtin">any</span></code></pre>
    Docs
    0
  • import { ApolloServer } from "apollo-server";
    import { ApolloServerPluginUsageReportingDisabled } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [ApolloServerPluginUsageReportingDisabled()],
    });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">class</span> <span class="token class-name">ApolloServer</span> <span class="token keyword">import</span> ApolloServer</code></pre>
    Docs
    0
  • const { ApolloServerPluginLandingPageDisabled } = require('apollo-server-core');
        ApolloServerPluginLandingPageDisabled()
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">function</span> <span class="token function">ApolloServerPluginLandingPageDisabled</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> ApolloServerPlugin <span class="token keyword">import</span> ApolloServerPluginLandingPageDisabled</code></pre>
    Docs
    0
  • const { ApolloServerPluginLandingPageDisabled } = require('apollo-server-core');
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginLandingPageDisabled()  ]
    });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">function</span> <span class="token function">ApolloServerPluginLandingPageDisabled</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> ApolloServerPlugin <span class="token keyword">import</span> ApolloServerPluginLandingPageDisabled</code></pre>
    Docs
    0
  • import { ApolloServerPluginLandingPageDisabled } from 'apollo-server-core';
    new ApolloServer({
      plugins: [
        ApolloServerPluginLandingPageDisabled(),
      ],
    });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">function</span> <span class="token function">ApolloServerPluginLandingPageDisabled</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> ApolloServerPlugin <span class="token keyword">import</span> ApolloServerPluginLandingPageDisabled</code></pre>
    Docs
    0
  • import { ApolloServerPluginLandingPageGraphQLPlayground,
             ApolloServerPluginLandingPageDisabled } from 'apollo-server-core';
    new ApolloServer({
      plugins: [
        process.env.NODE_ENV === 'production'
          ? ApolloServerPluginLandingPageDisabled()
          : ApolloServerPluginLandingPageGraphQLPlayground(),
      ],
    });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">function</span> <span class="token function">ApolloServerPluginLandingPageGraphQLPlayground</span><span class="token punctuation">(</span><span class="token parameter">options<span class="token operator">?</span><span class="token operator">:</span> ApolloServerPluginLandingPageGraphQLPlaygroundOptions</span><span class="token punctuation">)</span><span class="token operator">:</span> ApolloServerPlugin <span class="token keyword">import</span> ApolloServerPluginLandingPageGraphQLPlayground</code></pre>
    Docs
    0
  • import { ApolloServer } from "apollo-server";
    import {
      ApolloServerPluginLandingPageDisabled
    } from "apollo-server-core";
    
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        ApolloServerPluginLandingPageDisabled(),
      ],
    });
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">class</span> <span class="token class-name">ApolloServer</span> <span class="token keyword">import</span> ApolloServer</code></pre>
    Docs
    0
  • import { ApolloServer } from 'apollo-server-express';
    import { ApolloServerPluginDrainHttpServer } from 'apollo-server-core';
    import express from 'express';
    import http from 'http';
    
    async function startApolloServer(typeDefs, resolvers) {
      const app = express();
      const httpServer = http.createServer(app);
      const server = new ApolloServer({
        typeDefs,
        resolvers,
        plugins: [ApolloServerPluginDrainHttpServer({ httpServer })],
      });
      await server.start();
      server.applyMiddleware({ app });
      await new Promise<void>(resolve => httpServer.listen({ port: 4000 }, resolve));
      console.log(`πŸš€ Server ready at http://localhost:4000${server.graphqlPath}`);
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> ApolloServer</code></pre>
    Docs
    0
  • import { ApolloServer } from 'apollo-server-fastify';
    import { ApolloServerPluginDrainHttpServer } from 'apollo-server-core';
    import fastify, { FastifyInstance } from 'fastify';
    
    function fastifyAppClosePlugin(app: FastifyInstance): ApolloServerPlugin {
      return {
        async serverWillStart() {
          return {
            async drainServer() {
              await app.close();
            },
          };
        },
      };
    }
    
    async function startApolloServer(typeDefs, resolvers) {
      const app = fastify();
      const server = new ApolloServer({
        typeDefs,
        resolvers,
        plugins: [
          fastifyAppClosePlugin(app),
          ApolloServerPluginDrainHttpServer({ httpServer: app.server }),
        ],
      });
    
      await server.start();
      app.register(server.createHandler());
      await app.listen(4000);
      console.log(`πŸš€ Server ready at http://localhost:4000${server.graphqlPath}`);
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> ApolloServer</code></pre>
    Docs
    0
  • const express = require('express');
    const { ApolloServer } = require('apollo-server-express');
    const { ApolloServerPluginDrainHttpServer } = require('apollo-server-core');
    const { typeDefs, resolvers } = require('./schema');
    
    async function startApolloServer() {
      const app = express();
      const httpServer = http.createServer(app);
      const server = new ApolloServer({
        typeDefs,
        resolvers,
        plugins: [ApolloServerPluginDrainHttpServer({ httpServer })],
      });
    
      await server.start();
    
      // Additional middleware can be mounted at this point to run before Apollo.
      app.use('*', jwtCheck, requireAuth, checkScope);
    
      // Mount Apollo middleware here.
      server.applyMiddleware({ app, path: '/specialUrl' });
      await new Promise<void>(resolve => httpServer.listen({ port: 4000 }, resolve));
      console.log(`πŸš€ Server ready at http://localhost:4000${server.graphqlPath}`);
      return { server, app };
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">function</span> <span class="token function">express</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> core<span class="token punctuation">.</span><span class="token function">Express</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">namespace</span> express <span class="token keyword">import</span> express</code><div class="typing-tooltip-markup">Creates an Express application. The express() function is a top-level function exported by the express module.</div></pre>
    Docs
    0
  • const express = require('express');
    const { ApolloServer } = require('apollo-server-express');
    const { ApolloServerPluginDrainHttpServer } = require('apollo-server-core');
    const { typeDefs, resolvers } = require('./schema');
    const http = require('http');
    
    async function startApolloServer() {
      const app = express();
      const httpServer = http.createServer(app);
      const server = new ApolloServer({
        typeDefs,
        resolvers,
        plugins: [ApolloServerPluginDrainHttpServer({ httpServer })],
      });
    
      await server.start();
    
      // Mount Apollo middleware here.
      server.applyMiddleware({ app });
      await new Promise<void>(resolve => httpServer.listen({ port: 4000 }, resolve));
      console.log(`πŸš€ Server ready at http://localhost:4000${server.graphqlPath}`);
      return { server, app };
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">function</span> <span class="token function">express</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> core<span class="token punctuation">.</span><span class="token function">Express</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">namespace</span> express <span class="token keyword">import</span> express</code><div class="typing-tooltip-markup">Creates an Express application. The express() function is a top-level function exported by the express module.</div></pre>
    Docs
    0
  • import { ApolloServer } from 'apollo-server-koa';
    import { ApolloServerPluginDrainHttpServer } from 'apollo-server-core';
    import Koa from 'koa';
    import http from 'http';
    
    async function startApolloServer(typeDefs, resolvers) {
      const httpServer = http.createServer();
      const server = new ApolloServer({
        typeDefs,
        resolvers,
        plugins: [ApolloServerPluginDrainHttpServer({ httpServer })],
      });
    
      await server.start();
      const app = new Koa();
      server.applyMiddleware({ app });
      httpServer.on('request', app.callback());
      await new Promise<void>(resolve => httpServer.listen({ port: 4000 }, resolve));
      console.log(`πŸš€ Server ready at http://localhost:4000${server.graphqlPath}`);
      return { server, app };
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">import</span> ApolloServer</code></pre>
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples