How to use @apollographql/graphql-playground-react - 1 common examples

To help you get started, we’ve selected a few @apollographql/graphql-playground-react 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 keystonejs / keystone / packages / app-graphql-playground / index.js View on Github external
app.get(graphiqlPath, (req, res) => {
      const tab = { endpoint };
      if (req.query && req.query.query) {
        tab.query = req.query.query;
        tab.variables = req.query.variables;
      }

      res.setHeader('Content-Type', 'text/html');
      res.write(
        renderPlaygroundPage({
          endpoint,
          version: playgroundPkg.version,
          tabs: [tab],
          settings: { 'request.credentials': 'same-origin' },
        })
      );
      res.end();
    });

@apollographql/graphql-playground-react

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

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular @apollographql/graphql-playground-react functions