profusion / sgqlc

Simple GraphQL Client
https://sgqlc.readthedocs.io/
ISC License
513 stars 85 forks source link

Mutation with JSON field #99

Closed dsuess closed 4 years ago

dsuess commented 4 years ago

Say I have a mutation with the following type in GraphQL

Mutation.update(
    a: JSON
): ...

then the GraphQL mutation generated by sgqlc is invalid

>>> op = Operation(Mutation)
>>> op.update(a={'test': 123})
>>> print(op)
mutation {
    update(a: {"test": 123}) { }
}

whereas the valid GraphQL mutation would look like this (note the missing quotes):

mutation {
    update(a: {test: 123}) { }
}

Am I doing sth wrong here?

dsuess commented 4 years ago

Sorry, I just noted that JSON was a custom defined type in our system and not standard GraphQL