From b54dd2baa2a287eaa193aa7bcee72e3314beef69 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Tue, 9 Apr 2019 12:53:02 +1000 Subject: [PATCH] remove navigation members from root query --- .../GraphApi/EfGraphQLService_Navigation.cs | 14 -------- .../EfGraphQLService_NavigationConnection.cs | 16 --------- .../EfGraphQLService_NavigationList.cs | 16 +-------- .../GraphApi/IEfGraphQLService_Navigation.cs | 16 --------- .../IEfGraphQLService_NavigationConnection.cs | 10 ------ .../GraphApi/QueryGraphType.cs | 34 ------------------- 6 files changed, 1 insertion(+), 105 deletions(-) diff --git a/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_Navigation.cs b/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_Navigation.cs index 9e30644d..e8dc3eab 100644 --- a/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_Navigation.cs +++ b/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_Navigation.cs @@ -21,20 +21,6 @@ partial class EfGraphQLService return graph.AddField(field); } - public FieldType AddNavigationField( - ObjectGraphType graph, - string name, - Func, TReturn> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null) - where TReturn : class - { - Guard.AgainstNull(nameof(graph), graph); - var field = BuildNavigationField(name, resolve, includeNames, graphType, arguments); - return graph.AddField(field); - } - FieldType BuildNavigationField( string name, Func, TReturn> resolve, diff --git a/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationConnection.cs b/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationConnection.cs index 669d1c61..0d97f793 100644 --- a/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationConnection.cs +++ b/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationConnection.cs @@ -9,22 +9,6 @@ namespace GraphQL.EntityFramework { partial class EfGraphQLService { - public void AddNavigationConnectionField( - ObjectGraphType graph, - string name, - Func, IEnumerable> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null, - int pageSize = 10) - where TReturn : class - { - Guard.AgainstNull(nameof(graph), graph); - var connection = BuildListConnectionField(name, resolve, includeNames, pageSize, graphType); - var field = graph.AddField(connection.FieldType); - field.AddWhereArgument(arguments); - } - public void AddNavigationConnectionField( ObjectGraphType graph, string name, diff --git a/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationList.cs b/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationList.cs index bc3c1544..e5b2c0ae 100644 --- a/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationList.cs +++ b/src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationList.cs @@ -20,21 +20,7 @@ partial class EfGraphQLService var field = BuildNavigationField(graphType, name, resolve, includeNames, arguments); return graph.AddField(field); } - - public FieldType AddNavigationListField( - ObjectGraphType graph, - string name, - Func, IEnumerable> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null) - where TReturn : class - { - Guard.AgainstNull(nameof(graph), graph); - var field = BuildNavigationField(graphType, name, resolve, includeNames, arguments); - return graph.AddField(field); - } - + FieldType BuildNavigationField( Type graphType, string name, diff --git a/src/GraphQL.EntityFramework/GraphApi/IEfGraphQLService_Navigation.cs b/src/GraphQL.EntityFramework/GraphApi/IEfGraphQLService_Navigation.cs index c3db61c0..b500386a 100644 --- a/src/GraphQL.EntityFramework/GraphApi/IEfGraphQLService_Navigation.cs +++ b/src/GraphQL.EntityFramework/GraphApi/IEfGraphQLService_Navigation.cs @@ -14,14 +14,6 @@ public partial interface IEfGraphQLService IEnumerable includeNames = null) where TReturn : class; - FieldType AddNavigationField(ObjectGraphType graph, - string name, - Func, TReturn> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null) - where TReturn : class; - FieldType AddNavigationListField(ObjectGraphType graph, string name, Func, IEnumerable> resolve, @@ -29,13 +21,5 @@ public partial interface IEfGraphQLService IEnumerable arguments = null, IEnumerable includeNames = null) where TReturn : class; - - FieldType AddNavigationListField(ObjectGraphType graph, - string name, - Func, IEnumerable> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null) - where TReturn : class; } } \ No newline at end of file diff --git a/src/GraphQL.EntityFramework/GraphApi/IEfGraphQLService_NavigationConnection.cs b/src/GraphQL.EntityFramework/GraphApi/IEfGraphQLService_NavigationConnection.cs index 16e741df..ad4e850a 100644 --- a/src/GraphQL.EntityFramework/GraphApi/IEfGraphQLService_NavigationConnection.cs +++ b/src/GraphQL.EntityFramework/GraphApi/IEfGraphQLService_NavigationConnection.cs @@ -6,16 +6,6 @@ namespace GraphQL.EntityFramework { public partial interface IEfGraphQLService { - void AddNavigationConnectionField( - ObjectGraphType graph, - string name, - Func, IEnumerable> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null, - int pageSize = 10) - where TReturn : class; - void AddNavigationConnectionField( ObjectGraphType graph, string name, diff --git a/src/GraphQL.EntityFramework/GraphApi/QueryGraphType.cs b/src/GraphQL.EntityFramework/GraphApi/QueryGraphType.cs index 8e3f80ae..f065f78e 100644 --- a/src/GraphQL.EntityFramework/GraphApi/QueryGraphType.cs +++ b/src/GraphQL.EntityFramework/GraphApi/QueryGraphType.cs @@ -16,40 +16,6 @@ public QueryGraphType(IEfGraphQLService efGraphQlService) this.efGraphQlService = efGraphQlService; } - protected void AddNavigationConnectionField( - string name, - Func, IEnumerable> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null, - int pageSize = 10) - where TReturn : class - { - efGraphQlService.AddNavigationConnectionField(this, name, resolve, graphType, arguments, includeNames, pageSize); - } - - protected FieldType AddNavigationField( - string name, - Func, TReturn> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null) - where TReturn : class - { - return efGraphQlService.AddNavigationField(this, name, resolve, graphType, arguments, includeNames); - } - - protected FieldType AddNavigationListField( - string name, - Func, IEnumerable> resolve, - Type graphType = null, - IEnumerable arguments = null, - IEnumerable includeNames = null) - where TReturn : class - { - return efGraphQlService.AddNavigationListField(this, name, resolve, graphType, arguments, includeNames); - } - protected void AddQueryConnectionField( string name, Func, IQueryable> resolve,