1 | # `graphql-codegen-core`
|
2 |
|
3 | This package is in charge of converting `GraphQLSchema` and GraphQL client-side operations (query/mutation/subscription/fragment) into a template consumable JSON structure.
|
4 |
|
5 | The 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 |
|
10 | The 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 |
|
14 | The build process of this package is based on TypeScript and compiled with `typescript` compiler.
|
15 |
|
16 | To build this package, start by installing the package dependencies:
|
17 |
|
18 | ```
|
19 | $ npm install
|
20 | // Or, with Yarn
|
21 | $ yarn
|
22 | ```
|
23 |
|
24 | Then, you can use the existing NPM scripts to build the package:
|
25 |
|
26 | ```
|
27 | $ npm build
|
28 | // Or, with Yarn
|
29 | $ yarn build
|
30 | ```
|