graphql-python / graphql-python/graphene

Graphene Generic Scalar

Open
#1,253 0 comments 0 reactions 0 assignees View on GitHub
✨ enhancement
Dominant language
Python
Stars
8.2k
Forks
818
PR merge metrics
No merged PRs in 30d

Description

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 ?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing Graphene's Generic Scalar behavior and the example query shapes in the issue. Compare the requested keyed object response with the need for selectable fields; done means determining whether Graphene provides a built-in schema mechanism or whether the request requires a broader design change.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.