Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CLI whole query file is inserted in generated query field #433

Open
bonega opened this issue Aug 24, 2022 · 1 comment
Open

CLI whole query file is inserted in generated query field #433

bonega opened this issue Aug 24, 2022 · 1 comment

Comments

@bonega
Copy link

bonega commented Aug 24, 2022

When generating from a single query-file that contains multiple mutations I get:

pub mod op_a {
   pub const QUERY : & str = "mutation op_a\n mutation op_b\n"
...
}

When sending a graphql request, the response will complain about fields that are present in op_b.
If I manually remove op_b from the QUERY field it works.

Thanks for any help.

@kontrol-apa
Copy link

Run into the same issue today. I have 3 separate queries in a query file and the generated code had the same QUERY field ( pub const QUERY : & str = "query LargestSales($limit: Int!, $contract: String!) {\n sales ... ) for all 3 queries. Manually removing the unrelated parts did the job.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants