graphene schema for query input is list of dictionary / object

2.9k Views Asked by At

My query input is something like:

[{name: "joe", age: 20}, {name: "bob", age: 30}]

Then I use a resolver to return something similar like:

[{name: "joe", age: 20}, {name: "bob", age: 30}, {name: "jane", age: 21}]

Suppose I don't change the dataset, so no need to use mutate.

I am using flask_graphql and graphene

What's the better way to implement this? (I mean how to build the schema) Thanks!

1

There are 1 best solutions below

0
On

Not sure on use case but GenericScalar might help.

data = graphene.GenericScalar()

In mutation, this won't have any specific schema though. Input can accept any structure.