From 764f4a7cd6c127d64dff14c1ff2e25d51be5871c Mon Sep 17 00:00:00 2001 From: David Lebee Date: Fri, 5 Feb 2021 11:59:53 -0500 Subject: [PATCH] this dosent work, but i will leave it here to explore later. --- Demo/Startup.cs | 1 + .../PoweredSoft.CQRS.GraphQL.HotChocolate.csproj | 1 + .../QueryObjectType.cs | 14 ++++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Demo/Startup.cs b/Demo/Startup.cs index 9612d32..61ee19d 100644 --- a/Demo/Startup.cs +++ b/Demo/Startup.cs @@ -62,6 +62,7 @@ namespace Demo services .AddGraphQLServer() + .AddProjections() .AddQueryType(d => d.Name("Query")) .AddPoweredSoftQueries() .AddPoweredSoftDynamicQueries() diff --git a/PoweredSoft.CQRS.GraphQL.HotChocolate/PoweredSoft.CQRS.GraphQL.HotChocolate.csproj b/PoweredSoft.CQRS.GraphQL.HotChocolate/PoweredSoft.CQRS.GraphQL.HotChocolate.csproj index 73245fb..fd5be00 100644 --- a/PoweredSoft.CQRS.GraphQL.HotChocolate/PoweredSoft.CQRS.GraphQL.HotChocolate.csproj +++ b/PoweredSoft.CQRS.GraphQL.HotChocolate/PoweredSoft.CQRS.GraphQL.HotChocolate.csproj @@ -6,6 +6,7 @@ + diff --git a/PoweredSoft.CQRS.GraphQL.HotChocolate/QueryObjectType.cs b/PoweredSoft.CQRS.GraphQL.HotChocolate/QueryObjectType.cs index b8db845..a8492c9 100644 --- a/PoweredSoft.CQRS.GraphQL.HotChocolate/QueryObjectType.cs +++ b/PoweredSoft.CQRS.GraphQL.HotChocolate/QueryObjectType.cs @@ -36,12 +36,14 @@ namespace PoweredSoft.CQRS.GraphQL.HotChocolate if (q.QueryResultType.Namespace == "System.Linq" && q.QueryResultType.Name.Contains("IQueryable")) { //waiting on answer to be determined. - /*var genericArgument = q.QueryResultType.GetGenericArguments().First(); - var type = new ListType(new NonNullType(new NamedTypeNode)); - queryField.Type(type); - queryField.UsePaging(); - */ - + //this does not work + //var genericArgument = q.QueryResultType.GetGenericArguments().First(); + //var objectTypeOfAargument = typeof(ObjectType<>).MakeGenericType(genericArgument); + //var listType = typeof(ListType<>).MakeGenericType(objectTypeOfAargument); + //queryField.Type(objectTypeOfAargument); + //queryField.UseSingleOrDefault(); + //queryField.UseProjection(); + ////queryField.UsePaging(listType); queryField.Type(q.QueryResultType); } else