-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing Type and Generator for Mutation Payload #42
Comments
Hi, I'm not sure to understand your issue, but that's probably a bug on our side. It's probably related to this if that skips the generation of mock data for |
Ha! That looks like the culprit for sure! For now I just wrote a small codegen plugin that writes the missing import and type that I need. Is there a reason to skip Query and Mutation types? |
Yeah because it didn't make sense to create a mock So maybe it's the generation of |
Care to share what you've learned? I, too, am getting this issue and i understand why it's being omitted as what @ardeois stated. How do we go about fixing this? |
@naknode Can you share your use case as of why you would need |
@ardeois Sorry, I miswrote. I do not need Great library, btw! |
Ah sorry I understand your issue now. Or the easiest way is to keep generating You can do a PR to update this logic graphql-codegen-typescript-mock-data/src/index.ts Lines 391 to 393 in 3d2e679
|
@ardeois I am on the latest Can you show me where @arnonate is using it as a output type? I'm not an expert-level GraphQLer but I understand the fundamentals. :-) Thank you Also, it keeps generating imports of Thanks again! |
@naknode I just wrote a small plugin that appends this to the output:
It's not a perfect solution, but I am not actually mocking aQuery anywhere, just needed to get rid of the errors. Here is the plugin in my
|
While these types should not be used very often, it can happen another mock references a `Query` or `Mutation` type. Which means we'll declare a property value with `aQuery` or `aMutation` That's why we need to define those types Fixes #42
While these types should not be used very often, it can happen another mock references a `Query` or `Mutation` type. Which means we'll declare a property value with `aQuery` or `aMutation` That's why we need to define those types Fixes #42
Hello! Thanks for the script. I am seeing one issue with my schema. Mutation payloads have an optional
query
field that is not getting generated in the output mocks file. See screenshot below:If you can point me in the right direction I will happily contribute a solution. I am just not sure if I have my codegen options set correctly or if this will require a pull request.
The text was updated successfully, but these errors were encountered: