-
Notifications
You must be signed in to change notification settings - Fork 161
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
[urql] should respect omitOperationSuffix and typesPrefix options #93
Comments
So I decided to have a stab at this since it's starting to annoy me. First thing, I noticed there is an explicit test to ignore Same for components... So what is the stance here? Changing this here is technically a breaking change if someone uses |
@dotansimha So what about the |
Thanks, @FredyC , let's keep this open until we'll have a complete solution. |
@dotansimha Solution is simple, but I need someone to decide what is the "correct behavior". Apparently, it was intended to ignore |
same issue with the plugin |
Describe the bug
I am used to prefixing my operations with
Q/M/S/F
so I opted enabled optionomitOperationSuffix
. Unfortunately, the urql plugin doesn't consider that and uses wrong type names., Also for a reason, I like to prefix types withT
which is ignored by plugin as well.https://github.com/dotansimha/graphql-code-generator/blob/db1db14ad43bdd876b4eab053d41b074b872359c/packages/plugins/typescript/urql/src/visitor.ts#L87
To Reproduce
Steps to reproduce the behavior:
I tried to reproduce in codesandbox, but it's giving me weird errors: https://codesandbox.io/s/affectionate-montalcini-zcpsv?file=/codegen.yml
codegen.yml
config file:Expected behavior
The emitted types should not use operation type suffix when
omitOperationSuffix
is enabled. AndtypesPrefix
should be respected.The text was updated successfully, but these errors were encountered: