Skip to content

Commit 83d4be5

Browse files
author
Brandon Bernard
committed
Pending changes and refactoring to get the project to build. Runtime errors are now WIP...
1 parent 32434bd commit 83d4be5

23 files changed

Lines changed: 85 additions & 60 deletions

‎.github/copilot-instructions.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copilot Instructions
2+
3+
## Project Guidelines
4+
- For this workspace/task, minimize code churn and keep the scope of changes narrow when modifying code.

‎GraphQL.RepoDb.SqlServer/GraphQLMiddleware/GraphQLRepoDbMappingMiddleware.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using HotChocolate.Data.Projections.Context;
88
using HotChocolate.ResolverProcessingExtensions;
99
using RepoDb.SqlServer.PagingOperations.Reflection;
10+
using GraphQL.ResolverProcessingExtensions.Selections;
1011

1112
namespace HotChocolate.RepoDb
1213
{
@@ -31,7 +32,7 @@ public async Task InvokeAsync(IMiddlewareContext context)
3132
{
3233
var field = context.GetSelectedField();
3334

34-
if (field.Field.ResolverMember is MethodInfo resolverMethod
35+
if (field.GetResolverMethodInfo() is MethodInfo resolverMethod
3536
&& GetRepoDbMapperFactoryForResolver(resolverMethod) is { } repoDbMapperFactoryDelegate)
3637
{
3738
//ONLY initialize/retrieve the Params Context if the Resolver is requesting (via DI) the GraphQLRepoDbMapper0...

‎GraphQL.ResolverProcessingExtensions.Tests/GraphQL.ResolverProcessingExtensions.Tests.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
1313
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
1414
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
15-
<PackageReference Include="coverlet.collector" Version="6.0.0">
15+
<PackageReference Include="coverlet.collector" Version="10.0.1">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>

‎GraphQL.ResolverProcessingExtensions.Tests/TestServers/GraphQLHelloWorldTestServer.cs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
42
using HotChocolate;
5-
using HotChocolate.AspNetCore.Extensions;
6-
using HotChocolate.AspNetCore.Serialization;
7-
using HotChocolate.Execution.Configuration;
8-
using HotChocolate.ResolverProcessingExtensions;
93
using HotChocolate.ResolverProcessingExtensions.Tests.GraphQL;
10-
using HotChocolate.Resolvers;
11-
using Microsoft.AspNetCore.Builder;
12-
using Microsoft.AspNetCore.TestHost;
134
using Microsoft.Extensions.DependencyInjection;
145

156
namespace HotChocolate.ResolverProcessingExtensions.Tests

‎GraphQL.ResolverProcessingExtensions.Tests/TestServers/GraphQLStarWarsTestServer.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public GraphQLStarWarsTestServer(GraphQLTestServerFactory serverFactory)
2525
.AddType<StarWarsDroid>()
2626
.AddTypeExtension<HumanFieldResolvers>()
2727
.AddSorting()
28-
.SetPagingOptions(new PagingOptions()
28+
.ModifyPagingOptions(options =>
2929
{
30-
DefaultPageSize = 5,
31-
IncludeTotalCount = true,
32-
MaxPageSize = 10
30+
options.DefaultPageSize = 5;
31+
options.IncludeTotalCount = true;
32+
options.MaxPageSize = 10;
3333
})
3434
.AddResolverProcessingExtensions();
3535

‎GraphQL.ResolverProcessingExtensions.Tests/UnitTests/GraphQLTestBase.cs‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
using System;
2-
using Microsoft.AspNetCore.Builder;
3-
using Microsoft.AspNetCore.TestHost;
4-
using Microsoft.Extensions.DependencyInjection;
5-
using HotChocolate.ResolverProcessingExtensions.Tests.GraphQL;
6-
using HotChocolate.AspNetCore.Extensions;
7-
using HotChocolate.AspNetCore.Serialization;
8-
using HotChocolate.Execution.Configuration;
9-
using HotChocolate.Resolvers;
102

113
namespace HotChocolate.ResolverProcessingExtensions.Tests
124
{

GraphQL.ResolverProcessingExtensions/GraphQLMiddleware/PreProcessedResultsMiddlewareExtensions.cs renamed to GraphQL.ResolverProcessingExtensions/GraphQLMiddleware/ResolverProcessedResultsMiddlewareExtensions.cs

File renamed without changes.

GraphQL.ResolverProcessingExtensions/GraphQLMiddleware/PreProcessingResultsMiddleware.cs renamed to GraphQL.ResolverProcessingExtensions/GraphQLMiddleware/ResolverProcessingResultsMiddleware.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Reflection;
66
using System.Threading.Tasks;
77
using HotChocolate.Data.Projections.Context;
8+
using GraphQL.ResolverProcessingExtensions.Selections;
89

910
namespace HotChocolate.ResolverProcessingExtensions
1011
{
@@ -24,7 +25,7 @@ public async Task InvokeAsync(IMiddlewareContext context)
2425
IParamsContext paramsContextFacade = null;
2526

2627
var field = context.GetSelectedField();
27-
if (field.Field.ResolverMember is MethodInfo resolverMethod
28+
if (field.GetResolverMethodInfo() is MethodInfo resolverMethod
2829
&& DoesResolverNeedGraphQLParamsContext(resolverMethod))
2930
{
3031
paramsContextFacade = context.InitializeGraphQLParamsContextSafely();

‎GraphQL.ResolverProcessingExtensions/GraphQLParamsContext/GraphQLParamsContext.cs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,14 @@ protected virtual IReadOnlyList<ResolverProcessingDependencyLink> GatherDependen
157157
var results = new List<ResolverProcessingDependencyLink>();
158158
foreach (var selectionField in AllSelectionFields)
159159
{
160-
var contextData = selectionField?.graphqlFieldSelection?.Field?.ContextData;
161-
if (contextData?.ContainsKey(ResolverProcessingParentDependencies.ContextDataKey) == true
162-
&& contextData[ResolverProcessingParentDependencies.ContextDataKey] is IEnumerable<ResolverProcessingDependencyLink> dependencyLinks)
160+
var dependenciesFeature = selectionField?.GraphQLSelectedField?.Field?.Features.Get<ResolverProcessingParentDependenciesFeature>();
161+
if (dependenciesFeature?.Dependencies is IEnumerable<ResolverProcessingDependencyLink> dependencyLinks)
163162
{
164163
results.AddRange(dependencyLinks);
165164
}
166165
}
167166

168167
return results;
169168
}
170-
171169
}
172170
}

GraphQL.ResolverProcessingExtensions/GraphQLParamsContext/ParentProjectionDependencies/PreProcessingDependencyLink.cs renamed to GraphQL.ResolverProcessingExtensions/GraphQLParamsContext/ParentProjectionDependencies/ResolverProcessingDependencyLink.cs

File renamed without changes.

0 commit comments

Comments
 (0)