@graphql-markdown/graphql
v1.3.0
Published
GraphQL-Markdown GraphQL utilities.
Readme
@graphql-markdown/graphql
Low-level GraphQL schema utilities used by GraphQL-Markdown: schema loading, introspection, directive resolution, and the decorator predicates used to filter and group schema types. This package is a building block for @graphql-markdown/core and @graphql-markdown/printer-legacy; most users should not need to depend on it directly.
Installation
npm install @graphql-markdown/graphqlUsage
Loading a schema
import { GraphQLFileLoader } from "@graphql-tools/graphql-file-loader";
import { loadSchema } from "@graphql-markdown/graphql";
const schema = await loadSchema("./schema.graphql", {
loaders: [new GraphQLFileLoader()],
});Introspecting a schema
import { getSchemaMap } from "@graphql-markdown/graphql";
const schemaMap = getSchemaMap(schema);Filtering types with decorator predicates
import { and, hasDirectiveNamed, isEntity } from "@graphql-markdown/graphql";
const isDeprecatedObject = and(
isEntity("objects"),
hasDirectiveNamed("deprecated"),
);Documentation
License
GraphQL-Markdown packages are 100% free and open-source, under the MIT license.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest, you'll be creating employment for local families and restoring wildlife habitats.
