graphene icon indicating copy to clipboard operation
graphene copied to clipboard

Save variables from resolver for later use

Open giorgi94 opened this issue 5 years ago • 2 comments

I used graphene for my project and it worked quite well, but I had a really tough time modifying json response, for example adding count of total matched records. I read documentation, but it seems to be overly complicated, which resolves in duplicate responses to database, and hence slowing processes. I am working with quite large data, so duplicating responses to database is not an option. It would be very helpful if I could save some parameters from resolver to separate dictionary to later modify response. I think adding this feature would simplify workflow for many, who wants to use graphql in their projects.

giorgi94 avatar Sep 25 '20 19:09 giorgi94

I believe Dataloaders were invented right for this case.

Zagrebelin avatar Nov 23 '20 18:11 Zagrebelin

I checked it, thank you for telling about dataloaders, I missed this part. But from docs, it seems that it will make some extra operations to database, instead of temporary storaing parameteres from resolve method. Graphene is bloated, and I don't understand why python counterpart of graphql (javascript), should be exactly same as original.

giorgi94 avatar Nov 24 '20 05:11 giorgi94