Graphql-code-generator: Generate components for react-apollo in separated files

Created on 3 Apr 2019  路  4Comments  路  Source: dotansimha/graphql-code-generator

Is your feature request related to a problem? Please describe.

To avoid merges, I'd want to generate the react-apollo components in different files. For example. One component per file.

Describe the solution you'd like
It'll be great to have a config option to generate components in different files.

Describe alternatives you've considered
The output file name could accept a regex string, so the files could have a rule for their names.

Additional context
Could be something like that:

generates:
  differentFiles: true
    plugins:
      - typescript
      - typescript-operations
      - typescript-react-apollo
    overwrite:
      - true
core enhancement

Most helpful comment

Thanks @dotansimha
Your lib is awesome and thanks to it I did a great job.
graphql-code-generator was crucial for system development that I'm on
\o/

All 4 comments

Hi @andfs , thank you for reporting it.
It was discussed before here. We are currently only support only one output file, in order to avoid the complexity of maintaining imports between generated files.
We might add the feature in the future ;)

@dotansimha thanks for answering me :) I've made a great jog in this lib.

@andfs We are currently support near-operation-file preset (see docs on our website) - you can use this to generate one file per operation, and generate it near the original operation file.

Thanks @dotansimha
Your lib is awesome and thanks to it I did a great job.
graphql-code-generator was crucial for system development that I'm on
\o/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mszczepanczyk picture mszczepanczyk  路  3Comments

mdaouas picture mdaouas  路  3Comments

edorivai picture edorivai  路  3Comments

iamdanthedev picture iamdanthedev  路  3Comments

jagregory picture jagregory  路  3Comments