npm.io
0.1.1 • Published 3 years ago

@cloudcycle/postgraphile-graphql-schema-utils

Licence
MIT
Version
0.1.1
Deps
2
Size
25 kB
Vulns
0
Weekly
0

postgraphile-graphql-schema-utils

Utilities for extracting information from GraphQL schemas generated by Postgraphile

Example Usage

The code below demonstrates the usage of this library:

import { resolverNamesInSchema, loadSchemaFromFileSync } from '@cloudcycle/postgraphile-graphql-schema-utils';

const schema = loadSchemaFromFileSync('schema.graphql');
const {query, mutation} = resolverNamesInSchema(schema);
console.log(JSON.stringify('List of queries': query));
console.log(JSON.stringify('List of mutations': mutation));

An async API for loading the schema also available as loadSchemaFromFile.

Roadmap

  • Add unit tests.
  • Additional data-sources.

Keywords