-
-
Notifications
You must be signed in to change notification settings - Fork 397
fix(query): prioritize query over mutation for non-GET operations in generateQueryHook #2027
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
fix(query): prioritize query over mutation for non-GET operations in generateQueryHook #2027
Conversation
Running the tests now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the nice correction. I made a comment.
I think it needs to be reflected in the documentation, but I'll think about it for a bit.
8498b30
to
f4eb118
Compare
I have resolved the comments, thanks for the review 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Edward-Upton
Thanks!
I thought about documentation. Please clarify the specifications in the guide for the following options.
- Only valid when the verbs of the two mutations are not get and not query
- Prioritize
output.mutation
overoutput.orverride.mutation
- https://orval.dev/reference/configuration/output#usemutation
- https://orval.dev/reference/configuration/output#usemutation
Could you update docs ?
…generateQueryHook
…put configuration
f4eb118
to
3d8617b
Compare
I have updated the docs, and fixed the issue that was causing the build failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good !
It seems like this change broke samples, where we now get multiple implementation of the hooks |
@AllieJonsson |
@soartec-lab No, I tried generating samples in #2035 but the issue persists |
@AllieJonsson @Edward-Upton |
@soartec-lab isn't it weird that we don't see if samples break in the PR, but in the following PRs? That must mean that we don't correctly build/test samples? |
Status
READY
Fix #2025
Description
Ensures that only one of the queries or mutations are generated, giving priority to queries.
Todos
Steps to Test or Reproduce
Run on the test repo that shows the bug in action
https://github.com/Edward-Upton/orval-duplicate-hook-bug