diff --git a/Directory.Build.props b/Directory.Build.props index 95ea9b04..05577647 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -26,7 +26,7 @@ Recommended enable true - $(NoWarn);IDE0056;IDE0057;ASP0014 + $(NoWarn);IDE0056;IDE0057;ASP0014;CA1510;CA1513 GraphQL.Server.$(MSBuildProjectName) GraphQL.Server.$(MSBuildProjectName) diff --git a/README.md b/README.md index 0c90f78b..96d277e6 100644 --- a/README.md +++ b/README.md @@ -1004,6 +1004,15 @@ via the `multipart/form-data` content type as attached files. If you wish to al allow clients to send files as base-64 encoded strings, you can write a custom scalar better suited to your needs. +### Native AOT support + +GraphQL.NET Server fully supports Native AOT publishing with .NET 8.0 and later. +See [ASP.NET Core support for Native AOT](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot) +for a list of features supported by .NET 8.0. However, GraphQL.NET only provides limited +support for Native AOT publishing due to its extensive use of reflection. Please see +[GraphQL.NET Ahead-of-time compilation](https://github.com/graphql-dotnet/graphql-dotnet?tab=readme-ov-file#ahead-of-time-compilation) +for more information. + ## Samples The following samples are provided to show how to integrate this project with various diff --git a/src/Authorization.AspNetCore/Authorization.AspNetCore.csproj b/src/Authorization.AspNetCore/Authorization.AspNetCore.csproj index da7a7f65..7a1440c8 100644 --- a/src/Authorization.AspNetCore/Authorization.AspNetCore.csproj +++ b/src/Authorization.AspNetCore/Authorization.AspNetCore.csproj @@ -1,9 +1,10 @@ - netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0 + netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0;net8.0 Integration of GraphQL.NET validation subsystem into ASP.NET Core GraphQL;authentication;authorization;validation + true diff --git a/src/Transports.AspNetCore/Compatibility/DynamicallyAccessedMemberTypes.cs b/src/Transports.AspNetCore/Compatibility/DynamicallyAccessedMemberTypes.cs new file mode 100644 index 00000000..b63ae713 --- /dev/null +++ b/src/Transports.AspNetCore/Compatibility/DynamicallyAccessedMemberTypes.cs @@ -0,0 +1,102 @@ +// +#pragma warning disable +#nullable enable annotations +#if !NET5_0_OR_GREATER + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Diagnostics.CodeAnalysis +{ + /// + /// Specifies the types of members that are dynamically accessed. + /// + /// This enumeration has a attribute that allows a + /// bitwise combination of its member values. + /// + [global::System.Flags] + internal enum DynamicallyAccessedMemberTypes + { + /// + /// Specifies no members. + /// + None = 0, + + /// + /// Specifies the default, parameterless public constructor. + /// + PublicParameterlessConstructor = 0x0001, + + /// + /// Specifies all public constructors. + /// + PublicConstructors = 0x0002 | global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor, + + /// + /// Specifies all non-public constructors. + /// + NonPublicConstructors = 0x0004, + + /// + /// Specifies all public methods. + /// + PublicMethods = 0x0008, + + /// + /// Specifies all non-public methods. + /// + NonPublicMethods = 0x0010, + + /// + /// Specifies all public fields. + /// + PublicFields = 0x0020, + + /// + /// Specifies all non-public fields. + /// + NonPublicFields = 0x0040, + + /// + /// Specifies all public nested types. + /// + PublicNestedTypes = 0x0080, + + /// + /// Specifies all non-public nested types. + /// + NonPublicNestedTypes = 0x0100, + + /// + /// Specifies all public properties. + /// + PublicProperties = 0x0200, + + /// + /// Specifies all non-public properties. + /// + NonPublicProperties = 0x0400, + + /// + /// Specifies all public events. + /// + PublicEvents = 0x0800, + + /// + /// Specifies all non-public events. + /// + NonPublicEvents = 0x1000, + + /// + /// Specifies all interfaces implemented by the type. + /// + Interfaces = 0x2000, + + /// + /// Specifies all members. + /// + All = ~global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.None + } +} + +#endif diff --git a/src/Transports.AspNetCore/Compatibility/DynamicallyAccessedMembersAttribute.cs b/src/Transports.AspNetCore/Compatibility/DynamicallyAccessedMembersAttribute.cs new file mode 100644 index 00000000..0aac03bd --- /dev/null +++ b/src/Transports.AspNetCore/Compatibility/DynamicallyAccessedMembersAttribute.cs @@ -0,0 +1,66 @@ +// +#pragma warning disable +#nullable enable annotations +#if !NET5_0_OR_GREATER + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Diagnostics.CodeAnalysis +{ + /// + /// Indicates that certain members on a specified are accessed dynamically, + /// for example through . + /// + /// + /// This allows tools to understand which members are being accessed during the execution + /// of a program. + /// + /// This attribute is valid on members whose type is or . + /// + /// When this attribute is applied to a location of type , the assumption is + /// that the string represents a fully qualified type name. + /// + /// When this attribute is applied to a class, interface, or struct, the members specified + /// can be accessed dynamically on instances returned from calling + /// on instances of that class, interface, or struct. + /// + /// If the attribute is applied to a method it's treated as a special case and it implies + /// the attribute should be applied to the "this" parameter of the method. As such the attribute + /// should only be used on instance methods of types assignable to System.Type (or string, but no methods + /// will use it there). + /// + [global::System.AttributeUsage( + global::System.AttributeTargets.Field | + global::System.AttributeTargets.ReturnValue | + global::System.AttributeTargets.GenericParameter | + global::System.AttributeTargets.Parameter | + global::System.AttributeTargets.Property | + global::System.AttributeTargets.Method | + global::System.AttributeTargets.Class | + global::System.AttributeTargets.Interface | + global::System.AttributeTargets.Struct, + Inherited = false)] + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.Diagnostics.Conditional("MULTI_TARGETING_SUPPORT_ATTRIBUTES")] + internal sealed class DynamicallyAccessedMembersAttribute : global::System.Attribute + { + /// + /// Initializes a new instance of the class + /// with the specified member types. + /// + /// The types of members dynamically accessed. + public DynamicallyAccessedMembersAttribute(global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes memberTypes) + { + MemberTypes = memberTypes; + } + + /// + /// Gets the which specifies the type + /// of members dynamically accessed. + /// + public global::System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberTypes { get; } + } +} + +#endif diff --git a/src/Transports.AspNetCore/Extensions/GraphQLBuilderExtensions.cs b/src/Transports.AspNetCore/Extensions/GraphQLBuilderExtensions.cs index ec140b1e..161a65b7 100644 --- a/src/Transports.AspNetCore/Extensions/GraphQLBuilderExtensions.cs +++ b/src/Transports.AspNetCore/Extensions/GraphQLBuilderExtensions.cs @@ -1,3 +1,5 @@ +using System.Diagnostics.CodeAnalysis; + namespace GraphQL; /// @@ -12,7 +14,9 @@ public static class ServerGraphQLBuilderExtensions /// Requires to be registered within the dependency injection framework /// if calling directly. /// - public static IGraphQLBuilder AddUserContextBuilder(this IGraphQLBuilder builder) + public static IGraphQLBuilder AddUserContextBuilder< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TUserContextBuilder>( + this IGraphQLBuilder builder) where TUserContextBuilder : class, IUserContextBuilder { builder.Services.Register(DI.ServiceLifetime.Singleton); @@ -107,7 +111,9 @@ private static async Task SetAndExecuteAsync(ExecutionOptions o /// Registers with the dependency injection framework /// as a singleton of type . /// - public static IGraphQLBuilder AddWebSocketAuthentication(this IGraphQLBuilder builder) + public static IGraphQLBuilder AddWebSocketAuthentication< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TWebSocketAuthenticationService>( + this IGraphQLBuilder builder) where TWebSocketAuthenticationService : class, IWebSocketAuthenticationService { builder.Services.Register(DI.ServiceLifetime.Singleton); diff --git a/src/Transports.AspNetCore/Extensions/GraphQLHttpApplicationBuilderExtensions.cs b/src/Transports.AspNetCore/Extensions/GraphQLHttpApplicationBuilderExtensions.cs index 1c130e66..ba614350 100644 --- a/src/Transports.AspNetCore/Extensions/GraphQLHttpApplicationBuilderExtensions.cs +++ b/src/Transports.AspNetCore/Extensions/GraphQLHttpApplicationBuilderExtensions.cs @@ -1,3 +1,5 @@ +using System.Diagnostics.CodeAnalysis; + namespace Microsoft.AspNetCore.Builder; /// @@ -70,7 +72,9 @@ public static IApplicationBuilder UseGraphQL(this IApplicationBuilder b /// The path to the GraphQL endpoint which defaults to '/graphql' /// The arguments to pass to the middleware type instance's constructor. /// The received as parameter - public static IApplicationBuilder UseGraphQL(this IApplicationBuilder builder, string path = "/graphql", params object[] args) + public static IApplicationBuilder UseGraphQL< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods)] TMiddleware>( + this IApplicationBuilder builder, string path = "/graphql", params object[] args) where TMiddleware : GraphQLHttpMiddleware => builder.UseGraphQL(new PathString(path), args); @@ -82,7 +86,9 @@ public static IApplicationBuilder UseGraphQL(this IApplicationBuild /// The path to the GraphQL endpoint /// The arguments to pass to the middleware type instance's constructor. /// The received as parameter - public static IApplicationBuilder UseGraphQL(this IApplicationBuilder builder, PathString path, params object[] args) + public static IApplicationBuilder UseGraphQL< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods)] TMiddleware>( + this IApplicationBuilder builder, PathString path, params object[] args) where TMiddleware : GraphQLHttpMiddleware { return builder.UseWhen( diff --git a/src/Transports.AspNetCore/Extensions/GraphQLHttpEndpointRouteBuilderExtensions.cs b/src/Transports.AspNetCore/Extensions/GraphQLHttpEndpointRouteBuilderExtensions.cs index 950ced22..ce107809 100644 --- a/src/Transports.AspNetCore/Extensions/GraphQLHttpEndpointRouteBuilderExtensions.cs +++ b/src/Transports.AspNetCore/Extensions/GraphQLHttpEndpointRouteBuilderExtensions.cs @@ -1,5 +1,7 @@ #if !NETSTANDARD2_0 && !NETCOREAPP2_1 +using System.Diagnostics.CodeAnalysis; + namespace Microsoft.AspNetCore.Builder; /// @@ -47,7 +49,9 @@ public static GraphQLEndpointConventionBuilder MapGraphQL(this IEndpoin /// The route pattern. /// The arguments to pass to the middleware type instance's constructor. /// The received as parameter - public static GraphQLEndpointConventionBuilder MapGraphQL(this IEndpointRouteBuilder endpoints, string pattern = "graphql", params object[] args) + public static GraphQLEndpointConventionBuilder MapGraphQL< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods)] TMiddleware>( + this IEndpointRouteBuilder endpoints, string pattern = "graphql", params object[] args) where TMiddleware : GraphQLHttpMiddleware { var requestDelegate = endpoints.CreateApplicationBuilder().UseMiddleware(args).Build(); diff --git a/src/Transports.AspNetCore/Transports.AspNetCore.csproj b/src/Transports.AspNetCore/Transports.AspNetCore.csproj index 42259b2d..106219b2 100644 --- a/src/Transports.AspNetCore/Transports.AspNetCore.csproj +++ b/src/Transports.AspNetCore/Transports.AspNetCore.csproj @@ -1,9 +1,10 @@ - netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0 + netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net8.0 HTTP middleware for GraphQL GraphQL;middleware + true diff --git a/src/Ui.Altair/Internal/AltairPageModel.cs b/src/Ui.Altair/Internal/AltairPageModel.cs index 5acb7c8e..139f6665 100644 --- a/src/Ui.Altair/Internal/AltairPageModel.cs +++ b/src/Ui.Altair/Internal/AltairPageModel.cs @@ -1,4 +1,7 @@ using System.Text; +#if NET7_0_OR_GREATER +using System.Text.Json.Serialization; +#endif namespace GraphQL.Server.Ui.Altair.Internal; @@ -58,12 +61,26 @@ private static string StringEncode(string value) => value .Replace("'", "\\'") // encode ' as \' .Replace("\"", "\\\""); // encode " as \" - private static string JsonSerialize(object? value) +#nullable disable + private static string JsonSerialize(Dictionary value) +#nullable restore { #if NETSTANDARD2_0 return Newtonsoft.Json.JsonConvert.SerializeObject(value); +#elif NET7_0_OR_GREATER + return System.Text.Json.JsonSerializer.Serialize(value, SourceGenerationContext.Default.DictionaryStringObject); #else return System.Text.Json.JsonSerializer.Serialize(value); #endif } } + +#if NET7_0_OR_GREATER +[JsonSerializable(typeof(Dictionary))] +[JsonSerializable(typeof(bool))] +[JsonSerializable(typeof(int))] +[JsonSerializable(typeof(string))] +internal partial class SourceGenerationContext : JsonSerializerContext +{ +} +#endif diff --git a/src/Ui.Altair/Ui.Altair.csproj b/src/Ui.Altair/Ui.Altair.csproj index b12f9498..a4f5c009 100644 --- a/src/Ui.Altair/Ui.Altair.csproj +++ b/src/Ui.Altair/Ui.Altair.csproj @@ -1,9 +1,10 @@ - netcoreapp3.1;netstandard2.0 + netcoreapp3.1;netstandard2.0;net8.0 GraphQL Altair integration for ASP.NET Core Altair;GraphQL + true diff --git a/src/Ui.GraphiQL/Internal/GraphiQLPageModel.cs b/src/Ui.GraphiQL/Internal/GraphiQLPageModel.cs index ddc4b1d8..6ac0854f 100644 --- a/src/Ui.GraphiQL/Internal/GraphiQLPageModel.cs +++ b/src/Ui.GraphiQL/Internal/GraphiQLPageModel.cs @@ -1,4 +1,7 @@ using System.Text; +#if NET7_0_OR_GREATER +using System.Text.Json.Serialization; +#endif namespace GraphQL.Server.Ui.GraphiQL.Internal; @@ -67,12 +70,24 @@ private static string StringEncode(string value) => value .Replace("'", "\\'") // encode ' as \' .Replace("\"", "\\\""); // encode " as \" - private static string JsonSerialize(object value) + private static string JsonSerialize(Dictionary value) { #if NETSTANDARD2_0 return Newtonsoft.Json.JsonConvert.SerializeObject(value); +#elif NET7_0_OR_GREATER + return System.Text.Json.JsonSerializer.Serialize(value, SourceGenerationContext.Default.DictionaryStringObject); #else return System.Text.Json.JsonSerializer.Serialize(value); #endif } } + +#if NET7_0_OR_GREATER +[JsonSerializable(typeof(Dictionary))] +[JsonSerializable(typeof(bool))] +[JsonSerializable(typeof(int))] +[JsonSerializable(typeof(string))] +internal partial class SourceGenerationContext : JsonSerializerContext +{ +} +#endif diff --git a/src/Ui.GraphiQL/Ui.GraphiQL.csproj b/src/Ui.GraphiQL/Ui.GraphiQL.csproj index 9a7115f4..4bc74293 100644 --- a/src/Ui.GraphiQL/Ui.GraphiQL.csproj +++ b/src/Ui.GraphiQL/Ui.GraphiQL.csproj @@ -1,9 +1,10 @@ - netcoreapp3.1;netstandard2.0 + netcoreapp3.1;netstandard2.0;net8.0 GraphiQL integration for ASP.NET Core GraphiQL;GraphQL + true diff --git a/src/Ui.Playground/Internal/PlaygroundPageModel.cs b/src/Ui.Playground/Internal/PlaygroundPageModel.cs index c6384a52..e56dfc42 100644 --- a/src/Ui.Playground/Internal/PlaygroundPageModel.cs +++ b/src/Ui.Playground/Internal/PlaygroundPageModel.cs @@ -1,4 +1,7 @@ using System.Text; +#if NET7_0_OR_GREATER +using System.Text.Json.Serialization; +#endif namespace GraphQL.Server.Ui.Playground.Internal; @@ -67,12 +70,24 @@ private static string StringEncode(string value) => value .Replace("'", "\\'") // encode ' as \' .Replace("\"", "\\\""); // encode " as \" - private static string JsonSerialize(object value) + private static string JsonSerialize(Dictionary value) { #if NETSTANDARD2_0 return Newtonsoft.Json.JsonConvert.SerializeObject(value); +#elif NET7_0_OR_GREATER + return System.Text.Json.JsonSerializer.Serialize(value, SourceGenerationContext.Default.DictionaryStringObject); #else return System.Text.Json.JsonSerializer.Serialize(value); #endif } } + +#if NET7_0_OR_GREATER +[JsonSerializable(typeof(Dictionary))] +[JsonSerializable(typeof(bool))] +[JsonSerializable(typeof(int))] +[JsonSerializable(typeof(string))] +internal partial class SourceGenerationContext : JsonSerializerContext +{ +} +#endif diff --git a/src/Ui.Playground/Ui.Playground.csproj b/src/Ui.Playground/Ui.Playground.csproj index 2ba8b543..b934cb0a 100644 --- a/src/Ui.Playground/Ui.Playground.csproj +++ b/src/Ui.Playground/Ui.Playground.csproj @@ -1,9 +1,10 @@ - netcoreapp3.1;netstandard2.0 + netcoreapp3.1;netstandard2.0;net8.0 GraphQL Playground integration for ASP.NET Core GraphQL;Playground + true diff --git a/src/Ui.Voyager/Internal/VoyagerPageModel.cs b/src/Ui.Voyager/Internal/VoyagerPageModel.cs index ae4ea231..154d6eee 100644 --- a/src/Ui.Voyager/Internal/VoyagerPageModel.cs +++ b/src/Ui.Voyager/Internal/VoyagerPageModel.cs @@ -1,4 +1,7 @@ using System.Text; +#if NET7_0_OR_GREATER +using System.Text.Json.Serialization; +#endif namespace GraphQL.Server.Ui.Voyager.Internal; @@ -59,12 +62,24 @@ private static string StringEncode(string value) => value .Replace("'", "\\'") // encode ' as \' .Replace("\"", "\\\""); // encode " as \" - private static string JsonSerialize(object value) + private static string JsonSerialize(Dictionary value) { #if NETSTANDARD2_0 return Newtonsoft.Json.JsonConvert.SerializeObject(value); +#elif NET7_0_OR_GREATER + return System.Text.Json.JsonSerializer.Serialize(value, SourceGenerationContext.Default.DictionaryStringObject); #else return System.Text.Json.JsonSerializer.Serialize(value); #endif } } + +#if NET7_0_OR_GREATER +[JsonSerializable(typeof(Dictionary))] +[JsonSerializable(typeof(bool))] +[JsonSerializable(typeof(int))] +[JsonSerializable(typeof(string))] +internal partial class SourceGenerationContext : JsonSerializerContext +{ +} +#endif diff --git a/src/Ui.Voyager/Ui.Voyager.csproj b/src/Ui.Voyager/Ui.Voyager.csproj index e80b52a2..0a2f6e6f 100644 --- a/src/Ui.Voyager/Ui.Voyager.csproj +++ b/src/Ui.Voyager/Ui.Voyager.csproj @@ -1,9 +1,10 @@ - netcoreapp3.1;netstandard2.0 + netcoreapp3.1;netstandard2.0;net8.0 GraphQL Voyager integration for ASP.NET Core GraphQL;Voyager + true diff --git a/tests/ApiApprovalTests/net50+net60+net80/GraphQL.Server.Transports.AspNetCore.approved.txt b/tests/ApiApprovalTests/net50+net60+net80/GraphQL.Server.Transports.AspNetCore.approved.txt new file mode 100644 index 00000000..d3c12fde --- /dev/null +++ b/tests/ApiApprovalTests/net50+net60+net80/GraphQL.Server.Transports.AspNetCore.approved.txt @@ -0,0 +1,466 @@ +namespace GraphQL.Server.Transports.AspNetCore +{ + public static class AuthorizationHelper + { + public static System.Threading.Tasks.ValueTask AuthorizeAsync(GraphQL.Server.Transports.AspNetCore.AuthorizationParameters options, TState state) { } + } + public readonly struct AuthorizationParameters + { + public AuthorizationParameters(Microsoft.AspNetCore.Http.HttpContext httpContext, GraphQL.Server.Transports.AspNetCore.IAuthorizationOptions authorizationOptions, System.Func? onNotAuthenticated, System.Func? onNotAuthorizedRole, System.Func? onNotAuthorizedPolicy) { } + public bool AuthorizationRequired { get; } + public string? AuthorizedPolicy { get; } + public System.Collections.Generic.IEnumerable? AuthorizedRoles { get; } + public Microsoft.AspNetCore.Http.HttpContext HttpContext { get; } + public System.Func? OnNotAuthenticated { get; } + public System.Func? OnNotAuthorizedPolicy { get; } + public System.Func? OnNotAuthorizedRole { get; } + } + public class AuthorizationValidationRule : GraphQL.Validation.IValidationRule + { + public AuthorizationValidationRule() { } + public virtual System.Threading.Tasks.ValueTask ValidateAsync(GraphQL.Validation.ValidationContext context) { } + } + public class AuthorizationVisitor : GraphQL.Server.Transports.AspNetCore.AuthorizationVisitorBase + { + public AuthorizationVisitor(GraphQL.Validation.ValidationContext context, System.Security.Claims.ClaimsPrincipal claimsPrincipal, Microsoft.AspNetCore.Authorization.IAuthorizationService authorizationService) { } + protected Microsoft.AspNetCore.Authorization.IAuthorizationService AuthorizationService { get; } + protected System.Security.Claims.ClaimsPrincipal ClaimsPrincipal { get; } + protected override bool IsAuthenticated { get; } + protected override System.Threading.Tasks.ValueTask AuthorizeAsync(string policy) { } + protected override bool IsInRole(string role) { } + } + public abstract class AuthorizationVisitorBase : GraphQL.Validation.INodeVisitor + { + public AuthorizationVisitorBase(GraphQL.Validation.ValidationContext context) { } + protected abstract bool IsAuthenticated { get; } + protected abstract System.Threading.Tasks.ValueTask AuthorizeAsync(string policy); + public virtual System.Threading.Tasks.ValueTask EnterAsync(GraphQLParser.AST.ASTNode node, GraphQL.Validation.ValidationContext context) { } + protected virtual string GenerateResourceDescription(GraphQL.Server.Transports.AspNetCore.AuthorizationVisitorBase.ValidationInfo info) { } + protected System.Collections.Generic.List? GetRecursivelyReferencedUsedFragments(GraphQL.Validation.ValidationContext validationContext) { } + protected virtual void HandleNodeNotAuthorized(GraphQL.Server.Transports.AspNetCore.AuthorizationVisitorBase.ValidationInfo info) { } + protected virtual void HandleNodeNotInPolicy(GraphQL.Server.Transports.AspNetCore.AuthorizationVisitorBase.ValidationInfo info, string policy, Microsoft.AspNetCore.Authorization.AuthorizationResult authorizationResult) { } + protected virtual void HandleNodeNotInRoles(GraphQL.Server.Transports.AspNetCore.AuthorizationVisitorBase.ValidationInfo info, System.Collections.Generic.List roles) { } + protected abstract bool IsInRole(string role); + public virtual System.Threading.Tasks.ValueTask LeaveAsync(GraphQLParser.AST.ASTNode node, GraphQL.Validation.ValidationContext context) { } + protected virtual bool SkipNode(GraphQLParser.AST.ASTNode node, GraphQL.Validation.ValidationContext context) { } + protected virtual System.Threading.Tasks.ValueTask ValidateAsync(GraphQL.Server.Transports.AspNetCore.AuthorizationVisitorBase.ValidationInfo info) { } + public virtual System.Threading.Tasks.ValueTask ValidateSchemaAsync(GraphQL.Validation.ValidationContext context) { } + public readonly struct ValidationInfo : System.IEquatable + { + public ValidationInfo(GraphQL.Types.IProvideMetadata Obj, GraphQLParser.AST.ASTNode? Node, GraphQL.Types.IFieldType? ParentFieldType, GraphQL.Types.IGraphType? ParentGraphType, GraphQL.Validation.ValidationContext Context) { } + public GraphQL.Validation.ValidationContext Context { get; init; } + public GraphQLParser.AST.ASTNode? Node { get; init; } + public GraphQL.Types.IProvideMetadata Obj { get; init; } + public GraphQL.Types.IFieldType? ParentFieldType { get; init; } + public GraphQL.Types.IGraphType? ParentGraphType { get; init; } + } + } + public sealed class ExecutionResultActionResult : Microsoft.AspNetCore.Mvc.IActionResult + { + public ExecutionResultActionResult(GraphQL.ExecutionResult executionResult) { } + public ExecutionResultActionResult(GraphQL.ExecutionResult executionResult, System.Net.HttpStatusCode statusCode) { } + public string ContentType { get; set; } + public System.Threading.Tasks.Task ExecuteResultAsync(Microsoft.AspNetCore.Mvc.ActionContext context) { } + } + public class FormFileGraphType : GraphQL.Types.ScalarGraphType + { + public FormFileGraphType() { } + public override bool CanParseLiteral(GraphQLParser.AST.GraphQLValue value) { } + public override bool CanParseValue(object? value) { } + public override bool IsValidDefault(object value) { } + public override object? ParseLiteral(GraphQLParser.AST.GraphQLValue value) { } + public override object? ParseValue(object? value) { } + public override object? Serialize(object? value) { } + public override GraphQLParser.AST.GraphQLValue ToAST(object? value) { } + } + public class GraphQLExecutionActionResult : GraphQL.Server.Transports.AspNetCore.GraphQLExecutionActionResult + { + public GraphQLExecutionActionResult(GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddlewareOptions options) { } + public GraphQLExecutionActionResult(System.Action? configure = null) { } + } + public class GraphQLExecutionActionResult : Microsoft.AspNetCore.Mvc.IActionResult + where TSchema : GraphQL.Types.ISchema + { + public GraphQLExecutionActionResult(GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddlewareOptions options) { } + public GraphQLExecutionActionResult(System.Action? configure = null) { } + public virtual System.Threading.Tasks.Task ExecuteResultAsync(Microsoft.AspNetCore.Mvc.ActionContext context) { } + } + public class GraphQLHttpMiddleware : GraphQL.Server.Transports.AspNetCore.IUserContextBuilder + { + public GraphQLHttpMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, GraphQL.IGraphQLTextSerializer serializer, GraphQL.IDocumentExecuter documentExecuter, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory, GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddlewareOptions options, Microsoft.Extensions.Hosting.IHostApplicationLifetime hostApplicationLifetime) { } + protected virtual System.Collections.Generic.IEnumerable SupportedWebSocketSubProtocols { get; } + protected virtual System.Threading.Tasks.ValueTask?> BuildUserContextAsync(Microsoft.AspNetCore.Http.HttpContext context, object? payload) { } + protected virtual GraphQL.Server.Transports.AspNetCore.WebSockets.IOperationMessageProcessor CreateMessageProcessor(GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketConnection webSocketConnection, string subProtocol) { } + protected virtual GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketConnection CreateWebSocketConnection(Microsoft.AspNetCore.Http.HttpContext httpContext, System.Net.WebSockets.WebSocket webSocket, System.Threading.CancellationToken cancellationToken) { } + protected virtual System.Threading.Tasks.Task ExecuteRequestAsync(Microsoft.AspNetCore.Http.HttpContext context, GraphQL.Transport.GraphQLRequest? request, System.IServiceProvider serviceProvider, System.Collections.Generic.IDictionary? userContext) { } + protected virtual System.Threading.Tasks.Task ExecuteScopedRequestAsync(Microsoft.AspNetCore.Http.HttpContext context, GraphQL.Transport.GraphQLRequest? request, System.Collections.Generic.IDictionary? userContext) { } + protected virtual System.Threading.Tasks.ValueTask HandleAuthorizeAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.ValueTask HandleAuthorizeWebSocketConnectionAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.Task HandleBatchRequestAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next, System.Collections.Generic.IList gqlRequests) { } + protected virtual System.Threading.Tasks.Task HandleBatchedRequestsNotSupportedAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.Task HandleContentTypeCouldNotBeParsedErrorAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.ValueTask HandleDeserializationErrorAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next, System.Exception exception) { } + protected virtual System.Threading.Tasks.Task HandleInvalidContentTypeErrorAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.Task HandleInvalidHttpMethodErrorAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.Task HandleNotAuthenticatedAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.Task HandleNotAuthorizedPolicyAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.AspNetCore.Authorization.AuthorizationResult authorizationResult) { } + protected virtual System.Threading.Tasks.Task HandleNotAuthorizedRoleAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.Task HandleRequestAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next, GraphQL.Transport.GraphQLRequest gqlRequest) { } + protected virtual System.Threading.Tasks.Task HandleWebSocketAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + protected virtual System.Threading.Tasks.Task HandleWebSocketSubProtocolNotSupportedAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + public virtual System.Threading.Tasks.Task InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context) { } + protected virtual System.Threading.Tasks.Task InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { } + [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + "SingleRequest", + "BatchRequest"})] + protected virtual System.Threading.Tasks.Task?>?> ReadPostContentAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next, string? mediaType, System.Text.Encoding? sourceEncoding) { } + protected virtual string SelectResponseContentType(Microsoft.AspNetCore.Http.HttpContext context) { } + protected virtual System.Threading.Tasks.Task WriteErrorResponseAsync(Microsoft.AspNetCore.Http.HttpContext context, System.Net.HttpStatusCode httpStatusCode, GraphQL.ExecutionError executionError) { } + protected virtual System.Threading.Tasks.Task WriteErrorResponseAsync(Microsoft.AspNetCore.Http.HttpContext context, System.Net.HttpStatusCode httpStatusCode, string errorMessage) { } + protected virtual System.Threading.Tasks.Task WriteJsonResponseAsync(Microsoft.AspNetCore.Http.HttpContext context, System.Net.HttpStatusCode httpStatusCode, TResult result) { } + } + public class GraphQLHttpMiddlewareOptions : GraphQL.Server.Transports.AspNetCore.IAuthorizationOptions + { + public GraphQLHttpMiddlewareOptions() { } + public System.Collections.Generic.List AuthenticationSchemes { get; set; } + public bool AuthorizationRequired { get; set; } + public string? AuthorizedPolicy { get; set; } + public System.Collections.Generic.List AuthorizedRoles { get; set; } + public Microsoft.Net.Http.Headers.MediaTypeHeaderValue DefaultResponseContentType { get; set; } + public bool EnableBatchedRequests { get; set; } + public bool ExecuteBatchedRequestsInParallel { get; set; } + public bool HandleGet { get; set; } + public bool HandlePost { get; set; } + public bool HandleWebSockets { get; set; } + public int? MaximumFileCount { get; set; } + public long? MaximumFileSize { get; set; } + public bool ReadExtensionsFromQueryString { get; set; } + public bool ReadFormOnPost { get; set; } + public bool ReadQueryStringOnPost { get; set; } + public bool ReadVariablesFromQueryString { get; set; } + public bool ValidationErrorsReturnBadRequest { get; set; } + public GraphQL.Server.Transports.AspNetCore.WebSockets.GraphQLWebSocketOptions WebSockets { get; set; } + } + public class GraphQLHttpMiddleware : GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware + where TSchema : GraphQL.Types.ISchema + { + public GraphQLHttpMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, GraphQL.IGraphQLTextSerializer serializer, GraphQL.IDocumentExecuter documentExecuter, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory, GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddlewareOptions options, Microsoft.Extensions.Hosting.IHostApplicationLifetime hostApplicationLifetime) { } + protected override System.Threading.Tasks.ValueTask?> BuildUserContextAsync(Microsoft.AspNetCore.Http.HttpContext context, object? payload) { } + } + public sealed class HttpGetValidationRule : GraphQL.Validation.IValidationRule + { + public HttpGetValidationRule() { } + public System.Threading.Tasks.ValueTask ValidateAsync(GraphQL.Validation.ValidationContext context) { } + } + public sealed class HttpPostValidationRule : GraphQL.Validation.IValidationRule + { + public HttpPostValidationRule() { } + public System.Threading.Tasks.ValueTask ValidateAsync(GraphQL.Validation.ValidationContext context) { } + } + public interface IAuthorizationOptions + { + bool AuthorizationRequired { get; } + string? AuthorizedPolicy { get; } + System.Collections.Generic.IEnumerable AuthorizedRoles { get; } + } + public interface IUserContextBuilder + { + System.Threading.Tasks.ValueTask?> BuildUserContextAsync(Microsoft.AspNetCore.Http.HttpContext context, object? payload); + } + public interface IUserContextBuilder : GraphQL.Server.Transports.AspNetCore.IUserContextBuilder + where TSchema : GraphQL.Types.ISchema { } + public class UserContextBuilder : GraphQL.Server.Transports.AspNetCore.IUserContextBuilder + where TUserContext : System.Collections.Generic.IDictionary + { + public UserContextBuilder(System.Func> func) { } + public UserContextBuilder(System.Func func) { } + public UserContextBuilder(System.Func> func) { } + public UserContextBuilder(System.Func func) { } + public System.Threading.Tasks.ValueTask?> BuildUserContextAsync(Microsoft.AspNetCore.Http.HttpContext context, object? payload) { } + } +} +namespace GraphQL.Server.Transports.AspNetCore.Errors +{ + public class AccessDeniedError : GraphQL.Validation.ValidationError + { + public AccessDeniedError(string resource) { } + public AccessDeniedError(string resource, GraphQLParser.ROM originalQuery, params GraphQLParser.AST.ASTNode[] nodes) { } + public Microsoft.AspNetCore.Authorization.AuthorizationResult? PolicyAuthorizationResult { get; set; } + public string? PolicyRequired { get; set; } + public System.Collections.Generic.List? RolesRequired { get; set; } + } + public class BatchedRequestsNotSupportedError : GraphQL.Execution.RequestError + { + public BatchedRequestsNotSupportedError() { } + } + public class FileCountExceededError : GraphQL.Execution.RequestError, GraphQL.Server.Transports.AspNetCore.Errors.IHasPreferredStatusCode + { + public FileCountExceededError() { } + public System.Net.HttpStatusCode PreferredStatusCode { get; } + } + public class FileSizeExceededError : GraphQL.Execution.RequestError, GraphQL.Server.Transports.AspNetCore.Errors.IHasPreferredStatusCode + { + public FileSizeExceededError() { } + public System.Net.HttpStatusCode PreferredStatusCode { get; } + } + public class HttpMethodValidationError : GraphQL.Validation.ValidationError + { + public HttpMethodValidationError(GraphQLParser.ROM originalQuery, GraphQLParser.AST.ASTNode node, string message) { } + } + public interface IHasPreferredStatusCode + { + System.Net.HttpStatusCode PreferredStatusCode { get; } + } + public class InvalidContentTypeError : GraphQL.Execution.RequestError + { + public InvalidContentTypeError() { } + public InvalidContentTypeError(string message) { } + } + public class InvalidMapError : GraphQL.Execution.RequestError + { + public InvalidMapError(string message, System.Exception? innerException = null) { } + } + public class JsonInvalidError : GraphQL.Execution.RequestError + { + public JsonInvalidError() { } + public JsonInvalidError(System.Exception innerException) { } + } + public class WebSocketSubProtocolNotSupportedError : GraphQL.Execution.RequestError + { + public WebSocketSubProtocolNotSupportedError(System.Collections.Generic.IEnumerable requestedSubProtocols) { } + } +} +namespace GraphQL.Server.Transports.AspNetCore.WebSockets +{ + public abstract class BaseSubscriptionServer : GraphQL.Server.Transports.AspNetCore.WebSockets.IOperationMessageProcessor, System.IDisposable + { + protected BaseSubscriptionServer(GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketConnection connection, GraphQL.Server.Transports.AspNetCore.WebSockets.GraphQLWebSocketOptions options, GraphQL.Server.Transports.AspNetCore.IAuthorizationOptions authorizationOptions) { } + protected System.Threading.CancellationToken CancellationToken { get; } + protected GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketConnection Connection { get; } + protected virtual System.TimeSpan DefaultConnectionTimeout { get; } + protected virtual System.TimeSpan DefaultKeepAliveTimeout { get; } + protected bool Initialized { get; } + protected GraphQL.Server.Transports.AspNetCore.WebSockets.SubscriptionList Subscriptions { get; } + protected virtual System.Threading.Tasks.ValueTask AuthorizeAsync(GraphQL.Transport.OperationMessage message) { } + public virtual void Dispose() { } + protected virtual System.Threading.Tasks.Task ErrorAccessDeniedAsync() { } + protected virtual System.Threading.Tasks.Task ErrorConnectionInitializationTimeoutAsync() { } + protected virtual System.Threading.Tasks.Task ErrorIdAlreadyExistsAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task ErrorIdCannotBeBlankAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task ErrorNotInitializedAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task ErrorTooManyInitializationRequestsAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task ErrorUnrecognizedMessageAsync(GraphQL.Transport.OperationMessage message) { } + protected abstract System.Threading.Tasks.Task ExecuteRequestAsync(GraphQL.Transport.OperationMessage message); + protected virtual System.Threading.Tasks.Task HandleErrorDuringSubscribeAsync(GraphQL.Transport.OperationMessage message, System.Exception ex) { } + protected virtual System.Threading.Tasks.Task HandleErrorFromSourceAsync(System.Exception exception) { } + public virtual System.Threading.Tasks.Task InitializeConnectionAsync() { } + protected virtual System.Threading.Tasks.Task OnCloseConnectionAsync() { } + protected abstract System.Threading.Tasks.Task OnConnectionAcknowledgeAsync(GraphQL.Transport.OperationMessage message); + protected virtual System.Threading.Tasks.Task OnConnectionInitAsync(GraphQL.Transport.OperationMessage message, bool smartKeepAlive) { } + protected virtual System.Threading.Tasks.Task OnConnectionInitWaitTimeoutAsync() { } + public abstract System.Threading.Tasks.Task OnMessageReceivedAsync(GraphQL.Transport.OperationMessage message); + protected virtual System.Threading.Tasks.Task OnNotAuthenticatedAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task OnNotAuthorizedPolicyAsync(GraphQL.Transport.OperationMessage message, Microsoft.AspNetCore.Authorization.AuthorizationResult result) { } + protected virtual System.Threading.Tasks.Task OnNotAuthorizedRoleAsync(GraphQL.Transport.OperationMessage message) { } + protected abstract System.Threading.Tasks.Task OnSendKeepAliveAsync(); + protected abstract System.Threading.Tasks.Task SendCompletedAsync(string id); + protected abstract System.Threading.Tasks.Task SendDataAsync(string id, GraphQL.ExecutionResult result); + protected virtual System.Threading.Tasks.Task SendErrorResultAsync(GraphQL.Transport.OperationMessage message, GraphQL.ExecutionError executionError) { } + protected virtual System.Threading.Tasks.Task SendErrorResultAsync(GraphQL.Transport.OperationMessage message, GraphQL.ExecutionResult result) { } + protected virtual System.Threading.Tasks.Task SendErrorResultAsync(string id, GraphQL.ExecutionError executionError) { } + protected abstract System.Threading.Tasks.Task SendErrorResultAsync(string id, GraphQL.ExecutionResult result); + protected virtual System.Threading.Tasks.Task SendSingleResultAsync(GraphQL.Transport.OperationMessage message, GraphQL.ExecutionResult result) { } + protected virtual System.Threading.Tasks.Task SendSubscriptionSuccessfulAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task SubscribeAsync(GraphQL.Transport.OperationMessage message, bool overwrite) { } + protected bool TryInitialize() { } + protected virtual System.Threading.Tasks.Task UnsubscribeAsync(string? id) { } + } + public class GraphQLWebSocketOptions + { + public GraphQLWebSocketOptions() { } + public System.TimeSpan? ConnectionInitWaitTimeout { get; set; } + public bool DisconnectAfterAnyError { get; set; } + public bool DisconnectAfterErrorEvent { get; set; } + public System.TimeSpan? DisconnectionTimeout { get; set; } + public System.TimeSpan? KeepAliveTimeout { get; set; } + } + public interface IOperationMessageProcessor : System.IDisposable + { + System.Threading.Tasks.Task InitializeConnectionAsync(); + System.Threading.Tasks.Task OnMessageReceivedAsync(GraphQL.Transport.OperationMessage message); + } + public interface IWebSocketAuthenticationService + { + System.Threading.Tasks.Task AuthenticateAsync(GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketConnection connection, string subProtocol, GraphQL.Transport.OperationMessage operationMessage); + } + public interface IWebSocketConnection : System.IDisposable + { + Microsoft.AspNetCore.Http.HttpContext HttpContext { get; } + System.DateTime LastMessageSentAt { get; } + System.Threading.CancellationToken RequestAborted { get; } + System.Threading.Tasks.Task CloseAsync(); + System.Threading.Tasks.Task CloseAsync(int eventId, string? description); + System.Threading.Tasks.Task ExecuteAsync(GraphQL.Server.Transports.AspNetCore.WebSockets.IOperationMessageProcessor operationMessageProcessor); + System.Threading.Tasks.Task SendMessageAsync(GraphQL.Transport.OperationMessage message); + } + public sealed class SubscriptionList : System.IDisposable + { + public SubscriptionList() { } + public System.IDisposable this[string id] { set; } + public bool CompareExchange(string id, System.IDisposable oldSubscription, System.IDisposable newSubscription) { } + public bool Contains(string id) { } + public bool Contains(string id, System.IDisposable subscription) { } + public void Dispose() { } + public bool TryAdd(string id, System.IDisposable subscription) { } + public bool TryRemove(string id) { } + public bool TryRemove(string id, System.IDisposable oldSubscription) { } + } + public class WebSocketConnection : GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketConnection, System.IDisposable + { + public WebSocketConnection(Microsoft.AspNetCore.Http.HttpContext httpContext, System.Net.WebSockets.WebSocket webSocket, GraphQL.IGraphQLSerializer serializer, GraphQL.Server.Transports.AspNetCore.WebSockets.GraphQLWebSocketOptions options, System.Threading.CancellationToken requestAborted) { } + protected virtual System.TimeSpan DefaultDisconnectionTimeout { get; } + public Microsoft.AspNetCore.Http.HttpContext HttpContext { get; } + public System.DateTime LastMessageSentAt { get; } + public System.Threading.CancellationToken RequestAborted { get; } + public System.Threading.Tasks.Task CloseAsync() { } + public System.Threading.Tasks.Task CloseAsync(int eventId, string? description) { } + public virtual void Dispose() { } + public virtual System.Threading.Tasks.Task ExecuteAsync(GraphQL.Server.Transports.AspNetCore.WebSockets.IOperationMessageProcessor operationMessageProcessor) { } + protected virtual System.Threading.Tasks.Task OnCloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string? closeDescription) { } + protected virtual System.Threading.Tasks.Task OnDispatchMessageAsync(GraphQL.Server.Transports.AspNetCore.WebSockets.IOperationMessageProcessor operationMessageProcessor, GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task OnNonGracefulShutdownAsync(bool receivedCloseMessage, bool sentCloseMessage) { } + protected virtual System.Threading.Tasks.Task OnSendMessageAsync(GraphQL.Transport.OperationMessage message) { } + public System.Threading.Tasks.Task SendMessageAsync(GraphQL.Transport.OperationMessage message) { } + } +} +namespace GraphQL.Server.Transports.AspNetCore.WebSockets.GraphQLWs +{ + public static class MessageType + { + public const string Complete = "complete"; + public const string ConnectionAck = "connection_ack"; + public const string ConnectionInit = "connection_init"; + public const string Error = "error"; + public const string Next = "next"; + public const string Ping = "ping"; + public const string Pong = "pong"; + public const string Subscribe = "subscribe"; + } + public class SubscriptionServer : GraphQL.Server.Transports.AspNetCore.WebSockets.BaseSubscriptionServer + { + public SubscriptionServer(GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketConnection connection, GraphQL.Server.Transports.AspNetCore.WebSockets.GraphQLWebSocketOptions options, GraphQL.Server.Transports.AspNetCore.IAuthorizationOptions authorizationOptions, GraphQL.IDocumentExecuter executer, GraphQL.IGraphQLSerializer serializer, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder userContextBuilder, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService? authenticationService = null) { } + protected GraphQL.IDocumentExecuter DocumentExecuter { get; } + protected GraphQL.IGraphQLSerializer Serializer { get; } + protected Microsoft.Extensions.DependencyInjection.IServiceScopeFactory ServiceScopeFactory { get; } + protected System.Collections.Generic.IDictionary? UserContext { get; set; } + protected GraphQL.Server.Transports.AspNetCore.IUserContextBuilder UserContextBuilder { get; } + public static string SubProtocol { get; } + protected override System.Threading.Tasks.ValueTask AuthorizeAsync(GraphQL.Transport.OperationMessage message) { } + protected override System.Threading.Tasks.Task ExecuteRequestAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task OnCompleteAsync(GraphQL.Transport.OperationMessage message) { } + protected override System.Threading.Tasks.Task OnConnectionAcknowledgeAsync(GraphQL.Transport.OperationMessage message) { } + public override System.Threading.Tasks.Task OnMessageReceivedAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task OnPingAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task OnPongAsync(GraphQL.Transport.OperationMessage message) { } + protected override System.Threading.Tasks.Task OnSendKeepAliveAsync() { } + protected virtual System.Threading.Tasks.Task OnSubscribeAsync(GraphQL.Transport.OperationMessage message) { } + protected override System.Threading.Tasks.Task SendCompletedAsync(string id) { } + protected override System.Threading.Tasks.Task SendDataAsync(string id, GraphQL.ExecutionResult result) { } + protected override System.Threading.Tasks.Task SendErrorResultAsync(string id, GraphQL.ExecutionResult result) { } + } +} +namespace GraphQL.Server.Transports.AspNetCore.WebSockets.SubscriptionsTransportWs +{ + public static class MessageType + { + public const string GQL_COMPLETE = "complete"; + public const string GQL_CONNECTION_ACK = "connection_ack"; + public const string GQL_CONNECTION_ERROR = "connection_error"; + public const string GQL_CONNECTION_INIT = "connection_init"; + public const string GQL_CONNECTION_KEEP_ALIVE = "ka"; + public const string GQL_CONNECTION_TERMINATE = "connection_terminate"; + public const string GQL_DATA = "data"; + public const string GQL_ERROR = "error"; + public const string GQL_START = "start"; + public const string GQL_STOP = "stop"; + } + public class SubscriptionServer : GraphQL.Server.Transports.AspNetCore.WebSockets.BaseSubscriptionServer + { + public SubscriptionServer(GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketConnection connection, GraphQL.Server.Transports.AspNetCore.WebSockets.GraphQLWebSocketOptions options, GraphQL.Server.Transports.AspNetCore.IAuthorizationOptions authorizationOptions, GraphQL.IDocumentExecuter executer, GraphQL.IGraphQLSerializer serializer, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder userContextBuilder, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService? authenticationService = null) { } + protected GraphQL.IDocumentExecuter DocumentExecuter { get; } + protected GraphQL.IGraphQLSerializer Serializer { get; } + protected Microsoft.Extensions.DependencyInjection.IServiceScopeFactory ServiceScopeFactory { get; } + protected System.Collections.Generic.IDictionary? UserContext { get; set; } + protected GraphQL.Server.Transports.AspNetCore.IUserContextBuilder UserContextBuilder { get; } + public static string SubProtocol { get; } + protected override System.Threading.Tasks.ValueTask AuthorizeAsync(GraphQL.Transport.OperationMessage message) { } + protected override System.Threading.Tasks.Task ErrorAccessDeniedAsync() { } + protected override System.Threading.Tasks.Task ExecuteRequestAsync(GraphQL.Transport.OperationMessage message) { } + protected override System.Threading.Tasks.Task OnConnectionAcknowledgeAsync(GraphQL.Transport.OperationMessage message) { } + public override System.Threading.Tasks.Task OnMessageReceivedAsync(GraphQL.Transport.OperationMessage message) { } + protected override System.Threading.Tasks.Task OnSendKeepAliveAsync() { } + protected virtual System.Threading.Tasks.Task OnStartAsync(GraphQL.Transport.OperationMessage message) { } + protected virtual System.Threading.Tasks.Task OnStopAsync(GraphQL.Transport.OperationMessage message) { } + protected override System.Threading.Tasks.Task SendCompletedAsync(string id) { } + protected override System.Threading.Tasks.Task SendDataAsync(string id, GraphQL.ExecutionResult result) { } + protected override System.Threading.Tasks.Task SendErrorResultAsync(string id, GraphQL.ExecutionResult result) { } + } +} +namespace GraphQL +{ + public static class ServerGraphQLBuilderExtensions + { + public static GraphQL.DI.IGraphQLBuilder AddAuthorizationRule(this GraphQL.DI.IGraphQLBuilder builder) { } + public static GraphQL.DI.IGraphQLBuilder AddFormFileGraphType(this GraphQL.DI.IGraphQLBuilder builder) { } + public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] TUserContextBuilder>(this GraphQL.DI.IGraphQLBuilder builder) + where TUserContextBuilder : class, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder { } + public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder(this GraphQL.DI.IGraphQLBuilder builder, System.Func> creator) + where TUserContext : class, System.Collections.Generic.IDictionary { } + public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder(this GraphQL.DI.IGraphQLBuilder builder, System.Func creator) + where TUserContext : class, System.Collections.Generic.IDictionary { } + public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder(this GraphQL.DI.IGraphQLBuilder builder, System.Func> creator) + where TUserContext : class, System.Collections.Generic.IDictionary { } + public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder(this GraphQL.DI.IGraphQLBuilder builder, System.Func creator) + where TUserContext : class, System.Collections.Generic.IDictionary { } + public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService webSocketAuthenticationService) { } + public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, System.Func factory) { } + public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] TWebSocketAuthenticationService>(this GraphQL.DI.IGraphQLBuilder builder) + where TWebSocketAuthenticationService : class, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService { } + } +} +namespace GraphQL.Utilities.Federation +{ + public static class GraphQLHttpRequestExtensions + { + public static bool IsApolloFederatedTracingEnabled(this Microsoft.AspNetCore.Http.HttpRequest request) { } + } +} +namespace Microsoft.AspNetCore.Builder +{ + public class GraphQLEndpointConventionBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder + { + public void Add(System.Action convention) { } + } + public static class GraphQLHttpApplicationBuilderExtensions + { + public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseGraphQL(this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, Microsoft.AspNetCore.Http.PathString path, System.Action? configureMiddleware = null) { } + public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseGraphQL(this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, string path = "/graphql", System.Action? configureMiddleware = null) { } + public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseGraphQL(this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, Microsoft.AspNetCore.Http.PathString path, System.Action? configureMiddleware = null) + where TSchema : GraphQL.Types.ISchema { } + public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseGraphQL<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.None | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] TMiddleware>(this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, Microsoft.AspNetCore.Http.PathString path, params object[] args) + where TMiddleware : GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware { } + public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseGraphQL(this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, string path = "/graphql", System.Action? configureMiddleware = null) + where TSchema : GraphQL.Types.ISchema { } + public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseGraphQL<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.None | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] TMiddleware>(this Microsoft.AspNetCore.Builder.IApplicationBuilder builder, string path = "/graphql", params object[] args) + where TMiddleware : GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware { } + public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseIgnoreDisconnections(this Microsoft.AspNetCore.Builder.IApplicationBuilder builder) { } + } + public static class GraphQLHttpEndpointRouteBuilderExtensions + { + public static Microsoft.AspNetCore.Builder.GraphQLEndpointConventionBuilder MapGraphQL(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern = "graphql", System.Action? configureMiddleware = null) { } + public static Microsoft.AspNetCore.Builder.GraphQLEndpointConventionBuilder MapGraphQL(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern = "graphql", System.Action? configureMiddleware = null) + where TSchema : GraphQL.Types.ISchema { } + public static Microsoft.AspNetCore.Builder.GraphQLEndpointConventionBuilder MapGraphQL<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.None | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] TMiddleware>(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern = "graphql", params object[] args) + where TMiddleware : GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware { } + } +} \ No newline at end of file diff --git a/tests/ApiApprovalTests/net50+netcoreapp31/GraphQL.Server.Authorization.AspNetCore.approved.txt b/tests/ApiApprovalTests/net50+net80+netcoreapp31/GraphQL.Server.Authorization.AspNetCore.approved.txt similarity index 100% rename from tests/ApiApprovalTests/net50+netcoreapp31/GraphQL.Server.Authorization.AspNetCore.approved.txt rename to tests/ApiApprovalTests/net50+net80+netcoreapp31/GraphQL.Server.Authorization.AspNetCore.approved.txt diff --git a/tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Ui.Altair.approved.txt b/tests/ApiApprovalTests/net80+netcoreapp31/GraphQL.Server.Ui.Altair.approved.txt similarity index 100% rename from tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Ui.Altair.approved.txt rename to tests/ApiApprovalTests/net80+netcoreapp31/GraphQL.Server.Ui.Altair.approved.txt diff --git a/tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Ui.GraphiQL.approved.txt b/tests/ApiApprovalTests/net80+netcoreapp31/GraphQL.Server.Ui.GraphiQL.approved.txt similarity index 100% rename from tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Ui.GraphiQL.approved.txt rename to tests/ApiApprovalTests/net80+netcoreapp31/GraphQL.Server.Ui.GraphiQL.approved.txt diff --git a/tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Ui.Playground.approved.txt b/tests/ApiApprovalTests/net80+netcoreapp31/GraphQL.Server.Ui.Playground.approved.txt similarity index 100% rename from tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Ui.Playground.approved.txt rename to tests/ApiApprovalTests/net80+netcoreapp31/GraphQL.Server.Ui.Playground.approved.txt diff --git a/tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Ui.Voyager.approved.txt b/tests/ApiApprovalTests/net80+netcoreapp31/GraphQL.Server.Ui.Voyager.approved.txt similarity index 100% rename from tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Ui.Voyager.approved.txt rename to tests/ApiApprovalTests/net80+netcoreapp31/GraphQL.Server.Ui.Voyager.approved.txt diff --git a/tests/ApiApprovalTests/net50+net60+netcoreapp31/GraphQL.Server.Transports.AspNetCore.approved.txt b/tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Transports.AspNetCore.approved.txt similarity index 100% rename from tests/ApiApprovalTests/net50+net60+netcoreapp31/GraphQL.Server.Transports.AspNetCore.approved.txt rename to tests/ApiApprovalTests/netcoreapp31/GraphQL.Server.Transports.AspNetCore.approved.txt