-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
feat(query): allow body type customisation through mutator for mutations #319
Conversation
Someone is attempting to deploy a commit to a Personal Account owned by @anymaniax on Vercel. @anymaniax first needs to authorize it. |
98c07c2
to
8ad84f9
Compare
Again since this is adding new code I think this is another good improvement. |
8ad84f9
to
638e2ee
Compare
638e2ee
to
c26b7e0
Compare
What is the status of this one? Since the other one is merged |
I'll rework that one to take into account the changes from the other one, I'll ping you back when it's done :) |
ok thanks for the great work on this again |
92ae4b4
to
93e849d
Compare
@anymaniax I had to update the samples due to the last PR too. |
Good catch, I just pushed a fix :) |
3dfdd63
to
0318ad5
Compare
I updated the samples and add a new generated test named "custom-client" allowing to test the |
0318ad5
to
33670e7
Compare
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.
Thanks 🎉! Will do a release soon
Status
HOLD
Related PRs
Wait merging PR #318 before merging this one.✅Description
Look only at the last commit, the previous ones are from #318.
With those two PRs combined, we're now able to customise via the mutator the return type (see PR #318) (in my example, a server returning snake cased data that we want to camel case in our TS code) but also the body type (this PR) expecting by the operation function (since that the server is expecting snake cased keys, the mutator can handle that case change systematically) through a dedicated and optional type named
BodyType
.How it works
In the mutator, we can export a type named
BodyType
like following (similar to what we can do forErrorType
):Then, it will generated for the mutation:
Wdyt?
It might not be related to this PR but I personally think we might need more tests (with a snapshotting system?), at least to be able to see when a fix/feature is added how this is impacting the different scenarios because I think that TS won't be able catch everything imho.