Error "String cannot represent a non string value:" with graphene and Python

221 Views Asked by At

I have this simple query on python:

class Person(graphene.ObjectType):
    name = graphene.String() 

class Query(graphene.ObjectType):
    trial = graphene.Field(Person, manager=graphene.String())

    def resolve_trial(self, info, manager):
        print(manager)
        return Person(name="Person 1")

When call with this query:

query MyQuery($datamanager: String) {
  trial(manager: $datamanager) {
    name
  }
}

beeing datamanager

{
  "datamanager": {
    "skip": 0,
    "take": 12,
    "requiresCounts": true
  }
}

I got this error: "Variable '$datamanager' got invalid value {'skip': 0, 'take': 12, 'requiresCounts': True}; String cannot represent a non string value: {'skip': 0, 'take': 12, 'requiresCounts': True}"

I caanot change the way that datamanager is set, I use a syncfusion component and put the variable in this format. I have tried with manager=graphene.JSONString() but not working.

Any clue?

0

There are 0 best solutions below