Describe the bug
Hi, when I enable flow and flow-operations plugins at the same time, two // @flow headers are added to the graphql.js file.
To Reproduce
Steps to reproduce the behavior:
I tried to edit the template but it doesn't seem to work with the Flow plugins.
https://codesandbox.io/s/wizardly-paper-wsqgl?file=/document.graphql
Not relevant for the issue
Not relevant for the issue
codegen.yml config file:overwrite: true
schema: 'allSchema.graphql'
generates:
./src/generated/graphql.js:
documents: 'queries/*.js'
plugins:
- flow
- flow-operations
Expected behavior
Environment:
@graphql-codegen/flow: same as codesandbox@graphql-codegen/flow-operations: same as codesandboxAdditional context
I think this was introduced in: https://github.com/dotansimha/graphql-code-generator/pull/4609
Does it's breaking anything @FezVrasta ? or it's just semantics?
It errors in my create-react-app project
@FezVrasta build error or lint error? As far as I can tell, the Flow compiler works perfectly fine with that...

When the double comment is present, I also get a bunch of other errors on any file that imports from it, because it doesn't recognize the types.
Cannot use CreateAddendumMutationVariables as a type. A name can be used as a type only if it refers to a type,
interface, class, or enum definition. To get the type of a non-class value, use typeof. [value-as-type]
Having the the same issue. This is where flow throws:
| MultipleFlowAttributes ->
[
text "Unexpected ";
code "@flow";
text " declaration. Only one per ";
text "file is allowed.";
]
What if we remove // @flow prepend from flow operations since flow plugin already has it?
Fixed in @graphql-codegen/[email protected].
Most helpful comment
Fixed in
@graphql-codegen/[email protected].