graphene
graphene copied to clipboard
Graphene Generic Scalar
I have a list returning from query like this
[ { "name": "name1", "color":"red"}, { "name": "name2", "color": "green"} ]
but I want it to return like JSON e.g. { "name1": { "color": "red"}, "name2": { "color": "green"} }
for now I am using grapehe Generic Scalar to transform it e.g.
but the issue with this is that in query we cannot specify fields while writing query for this, e.g. we cannot do
{ user { color ... } }
rather we will only query
{ user }
do we have any built in solutions for this in graphene ?