-
Notifications
You must be signed in to change notification settings - Fork 89
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
Deep nested objects in django won't work due to async #84
Comments
UP ! |
Facing the same issue. |
Could you please elaborate ? |
I have ended by used ObjectType because ModelType always return error with relationship as you think actualy I can't use async with the proper way. |
Hey thank you for the quick response. If you can help that would be great. Also, I'll put my code below for you reference. This is my suscriptions.py
Below is my types.py
Any and all help is much appreciated!!!! |
Up! I guess? No news for one year? |
Description
I am trying to get clients to subscribe to my graphql with a nested object in django. The request looks like this:
Tasks contain one result which contain multiple profiles.
What I Did
In my subscription class I used the sync_to_async method which works if used for the first level:
Using the query only targeting task.id everything works perfectly. Once I try to target task.result (which is a new object). I receive the error:
I managed to get a workaround by updating the TaskType and updating the resolver for the result like so:
That way I could get to the next level (task -> result). When I try to subscribe to task -> result -> profiles there is no way to receive the data anymore. The same error from above is thrown. Even if I update the ResultType accordingly to fetch all profiles async:
I thought dynamic querying of objects and subscribing to nested objects would be an out of the box functionality but it is really difficult. I can't be the only person using this repo to actually receive ORM data?
The text was updated successfully, but these errors were encountered: