How to use the graphql-playground-middleware-koa.default function in graphql-playground-middleware-koa

To help you get started, we’ve selected a few graphql-playground-middleware-koa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ctco / nodejs-graphql-template / src / app.ts View on Github external
}));
}

// GraphiQL?
if (process.env.GRAPHIQL) {
  router.get(
    `/${paths.GRAPHIQL_PATH}`,
    graphiqlKoa({ endpointURL: GRAPHQL_ENDPOINT }),
  );
}

// GraphQL Playground?
if (process.env.PLAYGROUND) {
  router.all(
    `/${paths.PLAYGROUND_PATH}`,
    koaPlayground({ endpoint: GRAPHQL_ENDPOINT }),
  );
}

// Koa Heartbeat
app.use(koaHeartbeat({ path: `/${paths.LIVENESS_PATH}`, body: 'ok' }));

app.use(router.routes());
app.use(router.allowedMethods());

export default app;
github sid88in / serverless-appsync-plugin / graphql-playground.js View on Github external
]).then(([headers, endpoint]) => {
    const app = new Koa();
    app.use(koaPlayground({
      endpoint,
      settings: {
        'editor.cursorShape': 'line',
        'editor.reuseHeaders': true,
      },
      tabs: [{
        endpoint,
        headers,
      }],
    }));

    const port = options.port || 3000;
    app.listen(port);
    const graphiqlUrl = `http://localhost:${port}`;

    return graphiqlUrl;

graphql-playground-middleware-koa

GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis

Popular graphql-playground-middleware-koa functions