@graphql-reshape/transformers

0.5.1 • Public • Published

@graphql-reshape/transformers

GraphQL Reshape Logo

How to install

npm i @graphql-reshape/transformers

string -> [DocumentNode | string , boolean]

What is a transformer in this context?

A transformer is a function that takes in a graphql schema definition language (SDL) as a string and returns an array where the first element is the parsed schema or original string if not parsable and the second element is a boolean representing if the transform changed anything.

A transformer also can take an optional second argument which is an object that holds specific options for the transformer

How to use

Import the transformer directly and apply call it with a graphl schema (DocumentNode | string). This will return a parsed schema AST with the directive added. Typically you can then print the DocumentNode if you wanted to get back to the graphl schema definition language or you can pass the parsed DocumentNode to some function that can consume it like Apollo's makeExecutableSchema()

Package Sidebar

Install

npm i @graphql-reshape/transformers

Weekly Downloads

0

Version

0.5.1

License

MIT

Unpacked Size

42.8 kB

Total Files

18

Last publish

Collaborators

  • zieka