Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GraphQL Explorer #15319

Merged
merged 6 commits into from
Feb 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using GraphQL;
using GraphQL.Resolvers;
Expand Down Expand Up @@ -39,9 +38,6 @@ public void Build(FieldType contentQuery, ContentTypeDefinition contentTypeDefin
return;
}

IEnumerable<IObjectGraphType> queryObjectGraphTypes = null;
IEnumerable<IInputObjectGraphType> queryInputGraphTypes = null;

foreach (var part in contentTypeDefinition.Parts)
{
if (_contentOptions.ShouldSkip(part))
Expand All @@ -62,7 +58,7 @@ public void Build(FieldType contentQuery, ContentTypeDefinition contentTypeDefin
.GetOrAdd(part.PartDefinition.Name,
partName =>
{
queryObjectGraphTypes ??= serviceProvider.GetServices<IObjectGraphType>();
var queryObjectGraphTypes = serviceProvider.GetServices<IObjectGraphType>();
MikeAlhayek marked this conversation as resolved.
Show resolved Hide resolved
return queryObjectGraphTypes?.FirstOrDefault(x => x.GetType().BaseType.GetGenericArguments().First().Name == partName);
}
);
Expand Down Expand Up @@ -128,7 +124,7 @@ public void Build(FieldType contentQuery, ContentTypeDefinition contentTypeDefin

var inputGraphTypeResolved = _partInputObjectGraphTypes.GetOrAdd(part.PartDefinition.Name, partName =>
{
queryInputGraphTypes ??= serviceProvider.GetServices<IInputObjectGraphType>();
var queryInputGraphTypes = serviceProvider.GetServices<IInputObjectGraphType>();
return queryInputGraphTypes?.FirstOrDefault(x => x.GetType().BaseType.GetGenericArguments().FirstOrDefault()?.Name == part.PartDefinition.Name);
});

Expand Down
Loading