-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Return specific Type on specific Mutation #5893
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
Return specific Type on specific Mutation #5893
Conversation
@Moumouls I like the implementation. I think we can try to optimize the |
Returning fields on On delete, returning fields like Cons: yes it's one more |
It also seems that for efficient caching in front-end applications using // Parse compatible cache policy
const cache = new InMemoryCache({
dataIdFromObject: object => object.objectId || null
}); |
@Moumouls I got it. So let's move forward with this. Let's discuss the objectId thing on a separate thread? |
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.
@Moumouls It looks good to me. I am only suggesting few optimizations to avoid the down side of having an additional read operation in the database for each mutation. But let me know your thoughts. Maybe we can optimize it later.
Yes we need more reflexion and feedbacks for this thing We can't optimizeAfter a short thinking about the full |
That's not true. When some change is done in a trigger, the changes are returned by the rest operation. |
take a look in this test here: |
@davimacedo oohh sorry only updatedAt for the update: https://docs.parseplatform.org/rest/guide/#updating-objects Are the docs correct? |
I think the docs were written before the triggers were introduced. They are actually wrong. The REST API returns all modified fields for both create and update operations after the afterTrigger runs. I reviewed a user's issue another day regarding this and I discovered that. The docs also confused me in that time. I will create an issue in the docs repo. |
BTW this was the PR that I learned about it :) It was added support to change the returned fields in the after save trigger. |
Now thinking again about the triggers that can change the original input, I see this PR's returning all fields even more useful for the developers :) |
@davimacedo okay so lets finish the work here for a full optimized return on |
Codecov Report
@@ Coverage Diff @@
## master #5893 +/- ##
==========================================
- Coverage 93.71% 93.71% -0.01%
==========================================
Files 153 153
Lines 10727 10765 +38
==========================================
+ Hits 10053 10088 +35
- Misses 674 677 +3
Continue to review full report at Codecov.
|
Everything seems good for me, if it seems good for you (@davimacedo ) too, tell me and then i will squash my commits ! |
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.
Nice job! LGTM!
* Return specific Type on specific Mutation * Add Optimization on Mutation * Optimize SignUp
Return specific Type on specific Mutation
Change login Args
Convert the
login
args into aninput
Return type
Me
onSignup
I made a shortcut, it probably needs to be improved.
#5863