diff --git a/samples/DataLoaderWithEFCore/DataLoaderWithEFCore/DataLoaderWithEFCore.csproj b/samples/DataLoaderWithEFCore/DataLoaderWithEFCore/DataLoaderWithEFCore.csproj index 63fde06..e95f175 100644 --- a/samples/DataLoaderWithEFCore/DataLoaderWithEFCore/DataLoaderWithEFCore.csproj +++ b/samples/DataLoaderWithEFCore/DataLoaderWithEFCore/DataLoaderWithEFCore.csproj @@ -1,10 +1,10 @@ - + - net6.0 + net6.0 9.0 - + @@ -15,7 +15,7 @@ - + diff --git a/samples/SimpleWebApp.Tests/SimpleWebApp.Tests.csproj b/samples/SimpleWebApp.Tests/SimpleWebApp.Tests.csproj index 4ccea90..6927a10 100644 --- a/samples/SimpleWebApp.Tests/SimpleWebApp.Tests.csproj +++ b/samples/SimpleWebApp.Tests/SimpleWebApp.Tests.csproj @@ -1,4 +1,4 @@ - + net7.0 @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -22,6 +22,6 @@ - + diff --git a/samples/SubscriptionsGraphQLServer/SubscriptionExample/SubscriptionExample/SubscriptionExample.csproj b/samples/SubscriptionsGraphQLServer/SubscriptionExample/SubscriptionExample/SubscriptionExample.csproj index 6877870..0735c09 100644 --- a/samples/SubscriptionsGraphQLServer/SubscriptionExample/SubscriptionExample/SubscriptionExample.csproj +++ b/samples/SubscriptionsGraphQLServer/SubscriptionExample/SubscriptionExample/SubscriptionExample.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/GraphQL.Conventions/Adapters/GraphTypeAdapter.cs b/src/GraphQL.Conventions/Adapters/GraphTypeAdapter.cs index 8a66758..a604663 100644 --- a/src/GraphQL.Conventions/Adapters/GraphTypeAdapter.cs +++ b/src/GraphQL.Conventions/Adapters/GraphTypeAdapter.cs @@ -86,10 +86,12 @@ private IObjectGraphType DeriveOperationType(GraphTypeInfo typeInfo) => private FieldType DeriveField(GraphFieldInfo fieldInfo) { + bool resolvable = fieldInfo.DeclaringType.IsOutputType && !fieldInfo.DeclaringType.IsInterfaceType; + if (fieldInfo.Type.IsObservable) { - var resolver = FieldResolverFactory(fieldInfo); - var streamResolver = new EventStreamResolver(resolver); + var resolver = resolvable ? FieldResolverFactory(fieldInfo) : null; + var streamResolver = resolvable ? new EventStreamResolver(resolver) : null; return new FieldType { Name = fieldInfo.Name, @@ -110,7 +112,7 @@ private FieldType DeriveField(GraphFieldInfo fieldInfo) DefaultValue = fieldInfo.DefaultValue, Type = GetType(fieldInfo.Type), Arguments = new QueryArguments(fieldInfo.Arguments.Where(arg => !arg.IsInjected).Select(DeriveArgument)), - Resolver = FieldResolverFactory(fieldInfo), + Resolver = resolvable ? FieldResolverFactory(fieldInfo) : null, }; } diff --git a/src/GraphQL.Conventions/GraphQL.Conventions.csproj b/src/GraphQL.Conventions/GraphQL.Conventions.csproj index 508bb4d..89193b6 100644 --- a/src/GraphQL.Conventions/GraphQL.Conventions.csproj +++ b/src/GraphQL.Conventions/GraphQL.Conventions.csproj @@ -2,7 +2,7 @@ GraphQL Conventions for .NET - 7.2.0-preview + 7.2.1-preview Tommy Lillehagen net6.0;netstandard2.0 9.0 @@ -27,8 +27,8 @@ - - + + diff --git a/test/GraphQL.Conventions.Tests/GraphQL.Conventions.Tests.csproj b/test/GraphQL.Conventions.Tests/GraphQL.Conventions.Tests.csproj index f578128..1acfa88 100755 --- a/test/GraphQL.Conventions.Tests/GraphQL.Conventions.Tests.csproj +++ b/test/GraphQL.Conventions.Tests/GraphQL.Conventions.Tests.csproj @@ -12,12 +12,11 @@ - - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/SubscriptionExample.Tests/SubscriptionExample.Tests.csproj b/test/SubscriptionExample.Tests/SubscriptionExample.Tests.csproj index 32bc943..116322c 100644 --- a/test/SubscriptionExample.Tests/SubscriptionExample.Tests.csproj +++ b/test/SubscriptionExample.Tests/SubscriptionExample.Tests.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive