-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathApplicationBuilderExtensions.cs
28 lines (26 loc) · 1.01 KB
/
ApplicationBuilderExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using GraphQL.Server.Ui.Playground;
using GraphQL.Types;
using Microsoft.AspNetCore.Builder;
namespace Dotnet6.GraphQL4.Store.WebAPI.DependencyInjection.Extensions;
public static class ApplicationBuilderExtensions
{
public static IApplicationBuilder UseApplicationGraphQL<TSchema>(this IApplicationBuilder app)
where TSchema : ISchema
=> app
.UseWebSockets()
.UseGraphQLWebSockets<TSchema>()
.UseGraphQL<TSchema>()
.UseGraphQLPlayground(
options: new()
{
BetaUpdates = true,
RequestCredentials = RequestCredentials.Omit,
HideTracingResponse = false,
EditorCursorShape = EditorCursorShape.Line,
EditorTheme = EditorTheme.Dark,
EditorFontSize = 14,
EditorReuseHeaders = true,
EditorFontFamily = "JetBrains Mono"
},
path: "/ui/playground");
}