Skip to content

Commit ee5aef6

Browse files
authored
update GraphQL 4.6.0 (#743)
1 parent f28ee12 commit ee5aef6

33 files changed

Lines changed: 54 additions & 54 deletions

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ A user context that exposes both types.
333333
<!-- snippet: MultiUserContext -->
334334
<a id='snippet-multiusercontext'></a>
335335
```cs
336-
public class UserContext: Dictionary<string, object>
336+
public class UserContext: Dictionary<string, object?>
337337
{
338338
public UserContext(DbContext1 context1, DbContext2 context2)
339339
{
@@ -824,7 +824,7 @@ public class DerivedGraph :
824824
{
825825
AddNavigationConnectionField(
826826
name: "childrenFromInterface",
827-
e => e.Source.ChildrenFromBase);
827+
e => e.Source!.ChildrenFromBase);
828828
AutoMap();
829829
Interface<InterfaceGraph>();
830830
IsTypeOf = obj => obj is DerivedEntity;

docs/defining-graphs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ public class CompanyGraph :
9595
{
9696
AddNavigationListField(
9797
name: "employees",
98-
resolve: context => context.Source.Employees);
98+
resolve: context => context.Source!.Employees);
9999
AddNavigationConnectionField(
100100
name: "employeesConnection",
101-
resolve: context => context.Source.Employees,
101+
resolve: context => context.Source!.Employees,
102102
includeNames: new[] {"Employees"});
103103
AutoMap();
104104
}
@@ -224,7 +224,7 @@ public class CompanyGraph :
224224
{
225225
AddNavigationConnectionField(
226226
name: "employees",
227-
resolve: context => context.Source.Employees);
227+
resolve: context => context.Source!.Employees);
228228
}
229229
}
230230
```
@@ -327,7 +327,7 @@ Field<ListGraphType<EmployeeSummaryGraph>>(
327327

328328
if (context.HasArgument("where"))
329329
{
330-
var wheres = context.GetArgument<List<WhereExpression>>("where");
330+
var wheres = context.GetArgument<List<WhereExpression>>("where")!;
331331

332332
var predicate = ExpressionBuilder<Employee>.BuildPredicate(wheres);
333333
query = query.Where(predicate);

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.4</Version>
5+
<Version>15.0.5</Version>
66
<AssemblyVersion>1.0.0</AssemblyVersion>
77
<PackageTags>EntityFrameworkCore, EntityFramework, GraphQL</PackageTags>
88
<SignAssembly>false</SignAssembly>

src/GraphQL.EntityFramework/ComplexGraphResolver.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public static bool TryGetEntityTypeForField(this FieldType fieldType, [NotNullWh
3737
static Resolved GetOrAdd(FieldType fieldType)
3838
{
3939
return cache.GetOrAdd(
40-
fieldType.ResolvedType,
40+
fieldType.ResolvedType!,
4141
graphType =>
4242
{
4343
if (graphType is ListGraphType listGraphType)
4444
{
45-
graphType = listGraphType.ResolvedType;
45+
graphType = listGraphType.ResolvedType!;
4646
}
4747

4848
if (graphType is UnionGraphType unionGraphType)
@@ -52,13 +52,13 @@ static Resolved GetOrAdd(FieldType fieldType)
5252

5353
if (graphType is NonNullGraphType nonNullGraphType)
5454
{
55-
graphType = nonNullGraphType.ResolvedType;
55+
graphType = nonNullGraphType.ResolvedType!;
5656
if (graphType is ListGraphType innerListGraphType)
5757
{
58-
graphType = innerListGraphType.ResolvedType;
58+
graphType = innerListGraphType.ResolvedType!;
5959
if (graphType is NonNullGraphType innerNonNullGraphType)
6060
{
61-
graphType = innerNonNullGraphType.ResolvedType;
61+
graphType = innerNonNullGraphType.ResolvedType!;
6262
}
6363

6464
if (graphType is UnionGraphType innerUnionGraphType)

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public FieldType AddNavigationListField<TSource, TReturn>(
4040
var fieldContext = BuildContext(context);
4141
var result = resolve(fieldContext);
4242
result = result.ApplyGraphQlArguments(hasId, context);
43-
return fieldContext.Filters.ApplyFilter(result, context.UserContext);
43+
return fieldContext.Filters.ApplyFilter(result, context.UserContext)!;
4444
});
4545
}
4646

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_QueryableConnection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ void AddQueryableConnection<TSource, TGraph, TReturn>(
8080
return query
8181
.ApplyConnectionContext(
8282
context.First,
83-
context.After,
83+
context.After!,
8484
context.Last,
85-
context.Before,
85+
context.Before!,
8686
context,
8787
context.CancellationToken,
8888
efFieldContext.Filters);

src/GraphQL.EntityFramework/GraphQL.EntityFramework.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<PackageReference Include="ConfigureAwait.Fody" Version="3.3.1" PrivateAssets="All" />
88
<PackageReference Include="Fody" Version="6.5.2" PrivateAssets="all" />
99
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
10-
<PackageReference Include="GraphQL" Version="4.5.0" />
10+
<PackageReference Include="GraphQL" Version="4.6.0" />
1111
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
1212
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.9" />
1313
<PackageReference Include="NullabilityInfo" Version="0.1.15" PrivateAssets="All" />

src/GraphQL.EntityFramework/IncludeAppender.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ List<string> GetPaths(IResolveFieldContext context, IReadOnlyList<Navigation> na
5050
{
5151
List<string> list = new();
5252

53-
AddField(list, context.FieldAst, context.FieldAst.SelectionSet, null, context.FieldDefinition, navigationProperty, context);
53+
AddField(list, context.FieldAst, context.FieldAst.SelectionSet!, null, context.FieldDefinition, navigationProperty, context);
5454

5555
return list;
5656
}
@@ -66,7 +66,7 @@ void AddField(List<string> list, Field field, SelectionSet selectionSet, string?
6666

6767
foreach (var inlineFragment in selectionSet.Selections.OfType<InlineFragment>())
6868
{
69-
if (inlineFragment.Type.GraphTypeFromType(context.Schema) is IComplexGraphType graphFragment)
69+
if (inlineFragment.Type!.GraphTypeFromType(context.Schema) is IComplexGraphType graphFragment)
7070
{
7171
AddField(list, field, inlineFragment.SelectionSet, parentPath, fieldType, parentNavigationProperties, context, graphFragment);
7272
}
@@ -130,7 +130,7 @@ void ProcessSubFields(List<string> list, string? parentPath, ICollection<Field>
130130
var single = graph.Fields.SingleOrDefault(x => x.Name == subField.Name);
131131
if (single is not null)
132132
{
133-
AddField(list, subField, subField.SelectionSet, parentPath, single, navigationProperties, context);
133+
AddField(list, subField, subField.SelectionSet!, parentPath, single, navigationProperties, context);
134134
}
135135
}
136136
}
@@ -146,7 +146,7 @@ public static void SetIncludeMetadata(FieldType fieldType, string fieldName, IEn
146146
SetIncludeMetadata(fieldName, includeNames, fieldType.Metadata);
147147
}
148148

149-
static void SetIncludeMetadata(string fieldName, IEnumerable<string>? includeNames, IDictionary<string, object> metadata)
149+
static void SetIncludeMetadata(string fieldName, IEnumerable<string>? includeNames, IDictionary<string, object?> metadata)
150150
{
151151
if (includeNames is null)
152152
{
@@ -167,7 +167,7 @@ static bool TryGetIncludeMetadata(FieldType fieldType, [NotNullWhen(true)] out s
167167
{
168168
if (fieldType.Metadata.TryGetValue("_EF_IncludeName", out var fieldNameObject))
169169
{
170-
value = (string[])fieldNameObject;
170+
value = (string[])fieldNameObject!;
171171
return true;
172172
}
173173

src/GraphQL.EntityFramework/Mapping/SimpleFieldResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public SimpleFieldResolver(Func<TSource, object> func)
1414

1515
public object Resolve(IResolveFieldContext context)
1616
{
17-
return func((TSource) context.Source);
17+
return func((TSource) context.Source!);
1818
}
1919
}

src/GraphQL.EntityFramework/Where/ArgumentsAppender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static QueryArgument<IntGraphType> takeArgument()
5454

5555
public static void AddWhereArgument(this FieldType field, bool hasId, IEnumerable<QueryArgument>? extra)
5656
{
57-
var arguments = field.Arguments;
57+
var arguments = field.Arguments!;
5858
arguments.Add(whereArgument());
5959
arguments.Add(orderByArgument());
6060
if (hasId)

0 commit comments

Comments
 (0)