Union InputType?
See original GitHub issueI have three type.
class A(InputType):
pass
class B(InputType):
start_time = String()
class C(InputType):
start_time = String()
end_time = String()
So I hope that:
class T(Union):
class Meta:
types = (A, B, C)
the data maybe like:
{_type: A}
{_type:B, start_time: xxxx}
{_type:C, start_time:xxx, end_time: xxx}
By the way, why an ObjectType or InputType must have fields?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
GraphQL Union and Input Type?
Is it possible in GraphQL to have an input type that is also a union? Something like:
Read more >graphql-wg/InputUnion.md at main
Migrating a field to a polymorphic input type is non-breaking G. Input unions may include other input unions H. Input unions should accept...
Read more >What's the best way to input union types? : r/graphql
I was really counting on this but recently found out that this is not possible in the current specification.
Read more >Reaching Consensus: GraphQL Input Unions
GraphQL Unions represent an object that could be one of a list of GraphQL ... PostInput input type for text-based posts input PostInput ......
Read more >Unions
Read more about the GraphQL Union Type in the official GraphQL docs. Usage. Let's start by creating the object types from the example...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jkimbo the input union spec was updated on the GraphQL RFC.
And I think it is a very normal usage.Is there any way to solve it?