Closed madiganz closed 2 years ago
return/output types are not supposed to be used directly like the second case, the constructor signature is: https://github.com/profusion/sgqlc/blob/master/sgqlc/types/__init__.py#L1769
def __init__(self, json_data, selection_list=None):
the json_data
is what comes from the server, just like your first example.
However, for input types the constructor is slightly different and is to be used as you said: https://github.com/profusion/sgqlc/blob/master/sgqlc/types/__init__.py#L2619
def __init__(self, _json_obj=None, _selection_list=None, **kwargs):
it's expected to be used like your second example.
Does it answers your question?
Yes, this answers my question. Thanks!
The examples show that you can initialize a type using:
However this returns an error:
Is this the expected behavior? I would think it should be possible to initialize types with the fields and not using a dictionary.