graphql-query-builder-dotnet icon indicating copy to clipboard operation
graphql-query-builder-dotnet copied to clipboard

Any support for unions?

Open reureu opened this issue 4 years ago • 3 comments

Hi there,

Does GraphQL.Query.Builder support unions? https://graphql.org/learn/schema/#union-types

If not, have you got any plan to support unions in a not too distant future?

Regards, Reureu

reureu avatar May 25 '21 11:05 reureu

Hi @reureu,

GraphQL.Query.Builder doesn't support union, but it's a good idea. I will implement it in the future, but I cannot give you a date.

charlesdevandiere avatar May 25 '21 14:05 charlesdevandiere

Hi,

Great tool! Has there been any progress regarding the support for union types?

LoveWikberg avatar Sep 09 '22 13:09 LoveWikberg

Hi, I haven't started anything regarding union types . A pull request would be welcome if you want to contribute 😊

charlesdevandiere avatar Sep 12 '22 12:09 charlesdevandiere

Sorry for the wait. I just implemented union support in 2.2.0 #45

You can use:

IQuery<TSource> AddUnion<TUnionType>(string typeName, Func<IQuery<TUnionType>, IQuery<TUnionType>> build)

or

IQuery<TSource> AddUnion<TUnionType>(Func<IQuery<TUnionType>, IQuery<TUnionType>> build)

charlesdevandiere avatar Jul 25 '24 15:07 charlesdevandiere