UNPKG

1.34 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`](https://github.com/dotansimha/graphql-code-generator/blob/e9e4722723541628bc7ae58c0e4082556af4bfb8/packages/graphql-codegen-core/src/types.ts#L78-L94) object.
8* `transformDocument` - transforms GraphQL `DocumentNode` (object that can contains multiple GraphQL operations and fragments) to [`Document`](https://github.com/dotansimha/graphql-code-generator/blob/e9e4722723541628bc7ae58c0e4082556af4bfb8/packages/graphql-codegen-core/src/types.ts#L170-L175).
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 run build
28 // Or, with Yarn
29 $ yarn build
30```