asa-graphql-ts-typed-document

POC graphql-code-generator plugin for typed documents. Forked from https://github.com/dotansimha/graphql-code-generator


License
MIT
Install
npm install asa-graphql-ts-typed-document@2.0.2

Documentation

asa-graphql-ts-typed-document

CI

POC graphql-code-generator plugin for typed documents

This repo was forked from: https://github.com/dotansimha/graphql-code-generator/tree/master/packages/plugins/typescript/typed-document-node From commit 295382a150b73b58ccba754d03f2d1cfa11fae1c

The point of this fork is to add the ability to specify a fragmentImportsSourceMap config object, which provides a map of fragment name to filepath, thereby informing where to import types for each external fragment. For example:

{
  fragmentImportsSourceMap: {
    UserFragment: './fragments/_user-fragment.graphql'
  }
}

See the tests for behavior:

it('Should work with fragment imports via fragmentImportsSourceMap', async () => {