How to use the @kamilkisiela/graphql-tools.makeRemoteExecutableSchema function in @kamilkisiela/graphql-tools

To help you get started, we’ve selected a few @kamilkisiela/graphql-tools 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 ardatan / graphql-toolkit / packages / loaders / url / src / index.ts View on Github external
if (body.errors && body.errors.length > 0) {
      errorMessage = body.errors.map((item: Error) => item.message).join(', ');
    } else if (!body.data) {
      errorMessage = body;
    }

    if (errorMessage) {
      throw new Error('Unable to download schema from remote: ' + errorMessage);
    }

    if (!body.data.__schema) {
      throw new Error('Invalid schema provided!');
    }

    const clientSchema = buildClientSchema(body.data as IntrospectionQuery, options as any);
    const remoteExecutableSchema = makeRemoteExecutableSchema({
      schema: clientSchema,
      fetcher,
    });

    return {
      location: pointer,
      schema: remoteExecutableSchema,
    };
  }
}

@kamilkisiela/graphql-tools

Useful tools to create and manipulate GraphQL schemas.

MIT
Latest version published 5 years ago

Package Health Score

71 / 100
Full package analysis