-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
🐜 Bug Report
I'm using code generation. And I send mutations like this:
op = mutation_log_ticket_check()
endpoint(op, variables={
"ticketId": ticket_id,
"act": act,
"reason": reason,
"info": info,
})This throws an error TypeError: Object of type TicketCheckLogInfo is not JSON serializable, where info is an instance of an input type TicketCheckLogInfo:
class TicketCheckLogInfo(sgqlc.types.Input):
__schema__ = types
__field_names__ = ('summary', 'confidence', 'comment', 'is_tech', 'category')
summary = sgqlc.types.Field(String, graphql_name='summary')
confidence = sgqlc.types.Field(Int, graphql_name='confidence')
comment = sgqlc.types.Field(String, graphql_name='comment')
is_tech = sgqlc.types.Field(Boolean, graphql_name='isTech')
category = sgqlc.types.Field(String, graphql_name='category')Expected Behavior
I'm using code generation, so I suppose instances of generated input types would fit in the variable slots of operations, which are code that's also generated.
Please tell me if I'm using this lib in a wrong way and, if so, how to integrate input types into operations correctly.
Right now I'm using this as a workaround:
"info": TicketCheckLogInfo.__to_json_value__(info),
Current Behavior
Apparently, HTTPEndpoint.__call__ just dumps the variables dict into JSON.
Metadata
Metadata
Assignees
Labels
No labels