UNPKG

1.08 kBMarkdownView Raw
1# `graphql-codegen-core`
2
3This package is in charge of converting `GraphQLSchema` and GraphQL client-side operations (query/mutation/subscription/fragment) into a template consumable JSON structure.
4
5The entry points of this package are:
6
7* `schemaToTemplateContext` - transforms `GraphQLSchema` into [`SchemaTemplateContext`](./src/types.ts#L78-L94) object.
8* `transformDocument` - transforms GraphQL `DocumentNode` (object that can contains multiple GraphQL operations and fragments) to [`Document`](./src/types.ts#L195-L200).
9
10The purpose of the transformation is to simplify the links and connections between the GraphQL entities, and to add template indicators (`has...`, `is...`, `uses...`) to the context.
11
12## Build process
13
14The build process of this package is based on TypeScript and compiled with `typescript` compiler.
15
16To build this package, start by installing the package dependencies:
17
18```
19 $ npm install
20 // Or, with Yarn
21 $ yarn
22```
23
24Then, you can use the existing NPM scripts to build the package:
25
26```
27 $ npm build
28 // Or, with Yarn
29 $ yarn build
30```