Beispiel #1
0
 public static IRequestExecutorBuilder SetConfigurations(this IRequestExecutorBuilder graphqlServer, bool includeExceptionDetail)
 {
     graphqlServer
     .AddFiltering()
     .AddSorting()
     .AddProjections()
     .SetPagingOptions(new PagingOptions
     {
         IncludeTotalCount = true,
         DefaultPageSize   = 12,
         MaxPageSize       = 100
     })
     .AddAuthorization()
     .AddHttpRequestInterceptor((ctx, executor, builder, token) =>
     {
         var identity = ctx?.GetUser()?.Identity;
         if (identity is not null && identity.IsAuthenticated)
         {
             builder.SetProperty("session", new AuthSession(ctx.User));
         }
         return(ValueTask.CompletedTask);
     })
     .SetRequestOptions(provider => new RequestExecutorOptions {
         IncludeExceptionDetails = includeExceptionDetail
     });
     // Due to error in schema stiching, Uuid is already registerend on another type
     //.ConfigureSchema(x => x.BindClrType(typeof(Guid), typeof(UuidType)))
     //.AddDirectiveMergeHandler<DirectiveMerger>();
     return(graphqlServer);
 }
 public static IRequestExecutorBuilder AddCaseInsensitiveFilterConvention(this IRequestExecutorBuilder graphql)
 {
     return(graphql
            .AddFiltering <CaseInsensitiveFilteringConvention>());
 }