Skip to content

Commit

Permalink
Allow custom remote schema fetchers (#2425)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Oct 13, 2020
1 parent 3ddde48 commit 8299a94
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,24 @@ public static class HotChocolateStitchingRequestExecutorExtensions
ignoreRootTypes);
}

private static IRequestExecutorBuilder AddRemoteSchema(
public static IRequestExecutorBuilder AddRemoteSchema(
this IRequestExecutorBuilder builder,
NameString schemaName,
Func<IServiceProvider, CancellationToken, ValueTask<DocumentNode>> loadSchema,
bool ignoreRootTypes)
bool ignoreRootTypes = false)
{
if (builder is null)
{
throw new ArgumentNullException(nameof(builder));
}

if (loadSchema is null)
{
throw new ArgumentNullException(nameof(loadSchema));
}

schemaName.EnsureNotEmpty(nameof(schemaName));

// first we add a full GraphQL schema and executor that represents the remote schema.
// This remote schema will be used by the stitching engine to execute queries against
// this schema and also to lookup types in order correctly convert between scalars.
Expand Down

0 comments on commit 8299a94

Please sign in to comment.