How to use the apollo-server-env.URL function in apollo-server-env

To help you get started, we’ve selected a few apollo-server-env 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 apollographql / apollo-server / packages / apollo-server-cloudflare / src / cloudflareApollo.ts View on Github external
const graphqlHandler = async (req: Request): Promise => {
    const url = new URL(req.url);
    const query =
      req.method === 'POST'
        ? await req.json()
        : {
            query: url.searchParams.get('query'),
            variables: url.searchParams.get('variables'),
            operationName: url.searchParams.get('operationName'),
            extensions: url.searchParams.get('extensions'),
          };

    return runHttpQuery([req], {
      method: req.method,
      options: options,
      query,
      request: req as Request,
    }).then(

apollo-server-env

This package is used internally by Apollo Server and not meant to be consumed directly.

MIT
Latest version published 2 years ago

Package Health Score

72 / 100
Full package analysis