-
-
Notifications
You must be signed in to change notification settings - Fork 22
use_query and use_mutation #86
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
Conversation
06fa974
to
a863ad3
Compare
|
@Archmonger so the implementation I went with uses |
@Archmonger I've got to switch and work on some other things for a bit. If you're able to help get this over the finish by adding some docs or tests that would be great. |
Will do, but I am currently out on vacation. I'll get to it sometime after the 20th of this month. |
While I was writing out the docs I had a thought. Is there really any point to having separate I feel like the Perhaps that's just me not understanding the benefits of |
Yep, just tested that as well. Looks like the server they use to host dev docs is down. I might switch the docs off of the dev branch if this becomes a reoccurring issue. |
Ok, am able to repro the problem under 0.40.1 albeit with a slightly different error message:
However, under proposed changes in bypass-jsonpatch that problem goes away: |
I just tested out the current branch again, with client.js:29997 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'id')
at Object.replace (client.js:29997:26)
at applyOperation (client.js:30206:60)
at Object.applyPatch (client.js:30250:22)
at applyNonMutativePatch (client.js:30649:20)
at client.js:30633:20
at client.js:31298:48
replace @ client.js:29997
applyOperation @ client.js:30206
applyPatch @ client.js:30250
applyNonMutativePatch @ client.js:30649
(anonymous) @ client.js:30633
(anonymous) @ client.js:31298
Promise.then (async)
socket.onmessage @ client.js:31298
client.js:30213 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'children')
at applyOperation (client.js:30213:22)
at Object.applyPatch (client.js:30250:22)
at applyNonMutativePatch (client.js:30649:20)
at client.js:30633:20
at client.js:31298:48
applyOperation @ client.js:30213
applyPatch @ client.js:30250
applyNonMutativePatch @ client.js:30649
(anonymous) @ client.js:30633
(anonymous) @ client.js:31298
Promise.then (async)
socket.onmessage @ client.js:31298
client.js:3636 Warning: Encountered two children with the same key, `9`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
at ul
at StandardElement (http://127.0.0.1:8000/static/django_idom/client.js:31094:28)
at Element (http://127.0.0.1:8000/static/django_idom/client.js:31076:20)
at StandardElement (http://127.0.0.1:8000/static/django_idom/client.js:31094:28)
at Element (http://127.0.0.1:8000/static/django_idom/client.js:31076:20)
at div
at StandardElement (http://127.0.0.1:8000/static/django_idom/client.js:31094:28)
at Element (http://127.0.0.1:8000/static/django_idom/client.js:31076:20)
at StandardElement (http://127.0.0.1:8000/static/django_idom/client.js:31094:28)
at Element (http://127.0.0.1:8000/static/django_idom/client.js:31076:20)
at StandardElement (http://127.0.0.1:8000/static/django_idom/client.js:31094:28)
at Element (http://127.0.0.1:8000/static/django_idom/client.js:31076:20)
at StandardElement (http://127.0.0.1:8000/static/django_idom/client.js:31094:28)
at Element (http://127.0.0.1:8000/static/django_idom/client.js:31076:20)
at Layout (http://127.0.0.1:8000/static/django_idom/client.js:31060:19) |
I did some inspection of the code in my venv, seems like the |
This reverts commit b174a80.
Should I commit the |
Go for it! |
LGTM, ready for merge. |
Description
Adds
use_query
anduse_mutation
hooks. I haven't tested to see that these work as expected, but they get across the interface that I think we should provide for writing database operations.Checklist:
Please update this checklist as you complete each item:
changelog.rst
has been updated with any significant changes, if necessary.