Add support for batching several requests into one#38
Add support for batching several requests into one#38syrusakbary merged 2 commits intographql-python:masterfrom TangoAgency:batch
Conversation
Batch format compatible with ReactRelayNetworkLayer (https://github.com/nodkz/react-relay-network-layer)
|
Not sure why the |
|
Looks great!! Thanks for such a great PR! |
|
First of all, thanks a lot for adding this. I'm using apollo-client which also supports query batching but it expects the results to come back the same way as "normal" queries, in a data prop. where response['data'] is overwritten with this 'new' response instead. I did make this work by sub classing the GraphQLView and basically removed those lines but it seems a bit cumbersome since I have to copy/paste this entire function: and make the changes in there. Would it be an option to make the response format more pluggable in some way...perhaps like a function that we can overwrite instead that takes the execution result and returns the response, and that would default to response['data']. Then one could sub class the GraphQLView and just overwrite that function to return a different response format if so desired. |
|
@jole78 try setting response transform function as I would also suggest making the current implementation default to not break existing code. |
Batch format compatible with nodkz/react-relay-network-layer.
Tested only
POSTrequests withContent-Type: application/jsonsince I do not think it would be used differently.