Skip to content

Commit

Permalink
more gql updates?
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Aug 31, 2024
1 parent 72731a9 commit 153cea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/HotChocolate/Conventions/GraphqlConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public GraphqlConvention(
/// <inheritdoc />
public void Register(IConventionContext context, IConfiguration configuration, IServiceCollection services)
{
var sb = services
.AddGraphQL()
var sb = context
.GetOrAdd(() => services.AddGraphQL())
.AddFairyBread()
.AddErrorFilter<GraphqlErrorFilter>()
.BindRuntimeType<Unit, VoidType>();
Expand All @@ -50,4 +50,4 @@ public void Register(IConventionContext context, IConfiguration configuration, I
services.TryAddSingleton(_foundationOptions);
sb.AddType<AssemblyInfoQuery>();
}
}
}
7 changes: 4 additions & 3 deletions src/HotChocolate/Conventions/HotChocolateConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public void Register(IConventionContext context, IConfiguration configuration, I
dateTimeZoneProvider = new DateTimeZoneCache(context.Get<FoundationOptions>()?.DateTimeZoneSource ?? TzdbDateTimeZoneSource.Default);

services
.ConfigureOptions<HotChocolateContextDataConfigureOptions>()
.AddGraphQL()
.ConfigureOptions<HotChocolateContextDataConfigureOptions>();
context
.GetOrAdd(() => services.AddGraphQL())
.ConfigureSchema(sb => sb.AddNodaTime(dateTimeZoneProvider))
.AddInstrumentation();
}
}
}

0 comments on commit 153cea1

Please sign in to comment.