You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this documentation is incorrect; PetType() can't be instantiated since GraphQLUnionType's __init__ takes name and types as required parameters.
Calling PetType(name=PetType.name, ...) is obviously terrible, and implementing an empty __init__ which doesn't call super() feels unsafe.
Also, even if there's a way to define a UnionType via inheritance which I'm missing, I don't see why GraphQLUnionType example should be different from GraphQLInterfaceType example, which uses the normal function call API.
The text was updated successfully, but these errors were encountered:
GraphQLUnionType currently gives the following example of its usage:
I believe this documentation is incorrect;
PetType()
can't be instantiated since GraphQLUnionType's__init__
takes name and types as required parameters.Calling
PetType(name=PetType.name, ...)
is obviously terrible, and implementing an empty__init__
which doesn't callsuper()
feels unsafe.Also, even if there's a way to define a UnionType via inheritance which I'm missing, I don't see why GraphQLUnionType example should be different from GraphQLInterfaceType example, which uses the normal function call API.
The text was updated successfully, but these errors were encountered: