Skip to content

Commit a45d871

Browse files
committed
1 parent a9b1aa5 commit a45d871

5 files changed

Lines changed: 29 additions & 20 deletions

File tree

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CS1591;NU5104;CS1573</NoWarn>
5-
<Version>15.0.1</Version>
5+
<Version>15.0.2-beta.1</Version>
66
<AssemblyVersion>1.0.0</AssemblyVersion>
77
<PackageTags>EntityFrameworkCore, EntityFramework, GraphQL</PackageTags>
88
<SignAssembly>false</SignAssembly>

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationConnection.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Reflection;
55
using GraphQL.Builders;
66
using GraphQL.Types;
7+
using GraphQL.Types.Relay;
78
using Microsoft.EntityFrameworkCore;
89

910
namespace GraphQL.EntityFramework
@@ -45,7 +46,8 @@ void AddEnumerableConnection<TSource, TGraph, TReturn>(
4546
where TGraph : IGraphType
4647
where TReturn : class
4748
{
48-
var builder = ConnectionBuilder<TSource>.Create<TGraph>(name);
49+
var builder = ConnectionBuilder.Create<TGraph, TSource>();
50+
builder.Name(name);
4951

5052
if (description != null)
5153
{
@@ -76,6 +78,8 @@ void AddEnumerableConnection<TSource, TGraph, TReturn>(
7678
});
7779
}
7880

81+
// TODO: works around https://github.com/graphql-dotnet/graphql-dotnet/pull/2581/
82+
builder.FieldType.Type = typeof(NonNullGraphType<ConnectionType<TGraph, EdgeType<TGraph>>>);
7983
var field = graph.AddField(builder.FieldType);
8084

8185
field.AddWhereArgument(hasId, arguments);

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_QueryableConnection.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Reflection;
55
using GraphQL.Builders;
66
using GraphQL.Types;
7+
using GraphQL.Types.Relay;
78
using Microsoft.EntityFrameworkCore;
89

910
namespace GraphQL.EntityFramework
@@ -54,7 +55,8 @@ void AddQueryableConnection<TSource, TGraph, TReturn>(
5455
where TGraph : IGraphType
5556
where TReturn : class
5657
{
57-
var builder = ConnectionBuilder<TSource>.Create<TGraph>(name);
58+
var builder = ConnectionBuilder.Create<TGraph, TSource>();
59+
builder.Name(name);
5860
if (description != null)
5961
{
6062
builder.Description(description);
@@ -87,10 +89,13 @@ void AddQueryableConnection<TSource, TGraph, TReturn>(
8789
});
8890
}
8991

92+
// TODO: works around https://github.com/graphql-dotnet/graphql-dotnet/pull/2581/
93+
builder.FieldType.Type = typeof(NonNullGraphType<ConnectionType<TGraph, EdgeType<TGraph>>>);
9094
var field = graph.AddField(builder.FieldType);
9195

9296
var hasId = keyNames.ContainsKey(typeof(TReturn));
9397
field.AddWhereArgument(hasId, arguments);
9498
}
99+
95100
}
96-
}
101+
}

src/SampleWeb.Tests/SchemaPrint.Print.verified.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
type Company {
1+
type Company {
22
employees(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [Employee!]!
3-
employeesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): EmployeeConnection
3+
employeesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): EmployeeConnection!
44
content: String
55
id: Int!
66
}
@@ -77,10 +77,10 @@ type Query {
7777
companies(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [Company!]!
7878
company(id: ID, ids: [ID!], where: [WhereExpression!]): Company!
7979
companyOrNull(id: ID, ids: [ID!], where: [WhereExpression!]): Company
80-
companiesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): CompanyConnection
80+
companiesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): CompanyConnection!
8181
employees(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [Employee!]!
8282
employeesByArgument(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int, content: String): [Employee!]!
83-
employeesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): EmployeeConnection
83+
employeesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): EmployeeConnection!
8484
employeeSummary(where: [WhereExpression]): [EmployeeSummary]
8585
}
8686

src/Tests/IntegrationTests/IntegrationTests.SchemaPrint.verified.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type Child {
1+
type Child {
22
parentAlias: Parent
33
parent: Parent
44
id: ID!
@@ -56,7 +56,7 @@ type CustomType {
5656
}
5757

5858
type Derived implements Interface {
59-
childrenFromInterface(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): DerivedChildConnection
59+
childrenFromInterface(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): DerivedChildConnection!
6060
childrenFromBase(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [DerivedChild!]!
6161
id: ID!
6262
property: String
@@ -82,8 +82,8 @@ type DerivedChildEdge {
8282
}
8383

8484
type DerivedWithNavigation implements Interface {
85-
childrenFromInterface(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): DerivedChildConnection
86-
childrenFromDerived(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): DerivedChildConnection
85+
childrenFromInterface(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): DerivedChildConnection!
86+
childrenFromDerived(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): DerivedChildConnection!
8787
childrenFromBase(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [DerivedChild!]!
8888
children(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [DerivedChild!]!
8989
id: ID!
@@ -109,7 +109,7 @@ type FilterChildEdge {
109109
}
110110

111111
type FilterParent {
112-
childrenConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): FilterChildConnection
112+
childrenConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): FilterChildConnection!
113113
children(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [FilterChild!]!
114114
id: ID!
115115
property: String
@@ -142,7 +142,7 @@ type IncludeNonQueryableB {
142142
interface Interface {
143143
id: ID!
144144
property: String
145-
childrenFromInterface(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): DerivedChildConnection
145+
childrenFromInterface(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): DerivedChildConnection!
146146
}
147147

148148
type InterfaceConnection {
@@ -210,7 +210,7 @@ type PageInfo {
210210
}
211211

212212
type Parent {
213-
childrenConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): ChildConnection
213+
childrenConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): ChildConnection!
214214
children(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [Child!]!
215215
id: ID!
216216
property: String
@@ -255,17 +255,17 @@ type Query {
255255
misNamed(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [WithMisNamedQueryParent!]!
256256
parentEntities(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [Parent!]!
257257
childEntities(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [Child!]!
258-
parentEntitiesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): ParentConnection
259-
childEntitiesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): ChildConnection
258+
parentEntitiesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): ParentConnection!
259+
childEntitiesConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): ChildConnection!
260260
parentEntitiesFiltered(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [FilterParent!]!
261-
parentEntitiesConnectionFiltered(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): FilterParentConnection
261+
parentEntitiesConnectionFiltered(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): FilterParentConnection!
262262
parentEntity(id: ID, ids: [ID!], where: [WhereExpression!]): Parent!
263263
parentEntityNullable(id: ID, ids: [ID!], where: [WhereExpression!]): Parent
264-
interfaceGraphConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): InterfaceConnection
264+
interfaceGraphConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!], ids: [ID!]): InterfaceConnection!
265265
manyToManyLeftEntities(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [ManyToManyLeft!]!
266266
manyToManyRightEntities(id: ID, ids: [ID!], where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [ManyToManyRight!]!
267267
parentEntityViews(where: [WhereExpression!], orderBy: [OrderBy!], skip: Int, take: Int): [ParentView!]!
268-
parentEntitiesViewConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!]): ParentViewConnection
268+
parentEntitiesViewConnection(after: String, first: Int, before: String, last: Int, where: [WhereExpression!], orderBy: [OrderBy!]): ParentViewConnection!
269269
parentEntityView(where: [WhereExpression!]): ParentView!
270270
parentEntityViewNullable(where: [WhereExpression!]): ParentView
271271
}

0 commit comments

Comments
 (0)