Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private static async Task<JsonDocument> BuildVariablesAsync(
}

var jsonValueParser = new JsonValueParser(buffer: variableBuffer);
var bodyValue = jsonValueParser.Parse(result.Buffer);
var bodyValue = jsonValueParser.Parse(result.Buffer);
variables[bodyVariable] = bodyValue;
body.AdvanceTo(result.Buffer.End);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Text.Encodings.Web;
using System.Text.Json;
using HotChocolate.Execution;
using HotChocolate.Text.Json;
using Microsoft.AspNetCore.Http;
Expand All @@ -8,12 +6,6 @@ namespace HotChocolate.Adapters.OpenApi;

internal sealed class OpenApiResultFormatter : IOpenApiResultFormatter
{
private static readonly JsonWriterOptions s_jsonWriterOptions =
new() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };

private static readonly JsonSerializerOptions s_jsonSerializerOptions =
new() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };

public async Task FormatResultAsync(
OperationResult operationResult,
HttpContext httpContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using HotChocolate.Features;
using HotChocolate.Language;
using HotChocolate.Text.Json;
using static HotChocolate.Utilities.ThrowHelper;

namespace HotChocolate.ApolloFederation.Types;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using HotChocolate.Features;
using HotChocolate.Language;
using HotChocolate.Text.Json;
using static HotChocolate.Utilities.ThrowHelper;

namespace HotChocolate.ApolloFederation.Types;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.CommandLine.Parsing;
using HotChocolate.AspNetCore.CommandLine;

namespace Microsoft.Extensions.Hosting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using static System.Net.WebSockets.WebSocketMessageType;
using static HotChocolate.Transport.Sockets.SocketDefaults;
using static HotChocolate.Transport.Sockets.WellKnownProtocols;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ await executorSession.OnCreateAsync(
}

return new ExecuteRequestResult(
OperationResult.FromError([..ex.Errors]));
OperationResult.FromError([.. ex.Errors]));
}
catch (Exception ex)
{
Expand Down Expand Up @@ -352,7 +352,7 @@ public ParseRequestResult(GraphQLRequest request)
public ParseRequestResult(IReadOnlyList<IError> errors, HttpStatusCode statusCode)
{
IsValid = false;
Error = OperationResult.FromError([..errors]);
Error = OperationResult.FromError([.. errors]);
StatusCode = statusCode;
Request = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
using System.Net;
using System.Net.Http.Headers;
using System.IO.Pipelines;
using HotChocolate.Buffers;
using HotChocolate.Transport;
using HotChocolate.Fusion.Text.Json;
#else
using System.Net;
using System.Net.Http.Headers;
using System.Text.Json;
#endif
using HotChocolate.Buffers;

#if FUSION
namespace HotChocolate.Fusion.Transport.Http;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,8 @@ mutation CreateReviewForEpisode(
["ep"] = "JEDI",
["review"] = new Dictionary<string, object?>
{
["stars"] = 5, ["commentary"] = "This is a great movie!"
["stars"] = 5,
["commentary"] = "This is a great movie!"
}
});

Expand Down Expand Up @@ -876,7 +877,8 @@ mutation CreateReviewForEpisode(
["ep"] = "JEDI",
["review"] = new Dictionary<string, object?>
{
["stars"] = 5, ["commentary"] = "This is a great movie!"
["stars"] = 5,
["commentary"] = "This is a great movie!"
}
});

Expand Down Expand Up @@ -996,7 +998,8 @@ public async Task Post_GraphQL_FileUpload(string? contentType)

var request = new GraphQLHttpRequest(operation, requestUri)
{
Method = GraphQLHttpMethod.Post, EnableFileUploads = true
Method = GraphQLHttpMethod.Post,
EnableFileUploads = true
};

// act
Expand Down Expand Up @@ -1054,7 +1057,8 @@ public async Task Post_GraphQL_FileUpload_With_ObjectValueNode(string? contentTy

var request = new GraphQLHttpRequest(operation, requestUri)
{
Method = GraphQLHttpMethod.Post, EnableFileUploads = true
Method = GraphQLHttpMethod.Post,
EnableFileUploads = true
};

// act
Expand Down Expand Up @@ -1093,7 +1097,8 @@ public async Task Post_Subscription_Over_JsonLines()
stars
}
}
""")) { Method = GraphQLHttpMethod.Post, Accept = GraphQLHttpRequest.GraphQLOverHttp };
"""))
{ Method = GraphQLHttpMethod.Post, Accept = GraphQLHttpRequest.GraphQLOverHttp };

var mutationRequest = new OperationRequest(
"""
Expand All @@ -1110,7 +1115,8 @@ mutation CreateReviewForEpisode(
["ep"] = "JEDI",
["review"] = new Dictionary<string, object?>
{
["stars"] = 5, ["commentary"] = "This is a great movie!"
["stars"] = 5,
["commentary"] = "This is a great movie!"
}
});

Expand Down Expand Up @@ -1154,7 +1160,7 @@ public async Task ReadAsResult_Application_GraphQL_Response_Json_Response()
"application/graphql-response+json");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.OperationRequest("{ number }");
var operationRequest = new OperationRequest("{ number }");
var request = new GraphQLHttpRequest(operationRequest, new Uri("http://localhost:5000/graphql"));

// act
Expand Down Expand Up @@ -1182,7 +1188,7 @@ public async Task ReadAsResult_Application_Json_Response()
"application/json");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.OperationRequest("{ number }");
var operationRequest = new OperationRequest("{ number }");
var request = new GraphQLHttpRequest(operationRequest, new Uri("http://localhost:5000/graphql"));

// act
Expand Down Expand Up @@ -1210,7 +1216,7 @@ public async Task ReadAsResultStream_Single_Application_GraphQL_Response_Json_Re
"application/graphql-response+json");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.OperationRequest("{ number }");
var operationRequest = new OperationRequest("{ number }");
var request = new GraphQLHttpRequest(operationRequest, new Uri("http://localhost:5000/graphql"));

// act
Expand Down Expand Up @@ -1247,7 +1253,7 @@ public async Task ReadAsResultStream_Single_Application_Json_Response()
"application/json");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.OperationRequest("{ number }");
var operationRequest = new OperationRequest("{ number }");
var request = new GraphQLHttpRequest(operationRequest, new Uri("http://localhost:5000/graphql"));

// act
Expand Down Expand Up @@ -1286,7 +1292,7 @@ public async Task ReadAsResultStream_Single_Application_Json_Apollo_Request_Batc
"application/json");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.OperationBatchRequest(
var operationRequest = new OperationBatchRequest(
[
new OperationRequest("{ number }")
]);
Expand Down Expand Up @@ -1333,7 +1339,7 @@ public async Task ReadAsResultStream_Multi_Application_Json_Apollo_Request_Batch
"application/json");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.OperationBatchRequest(
var operationRequest = new OperationBatchRequest(
[
new OperationRequest("{ number }"),
new OperationRequest("{ number }")
Expand Down Expand Up @@ -1375,7 +1381,7 @@ public async Task ReadAsResultStream_Single_Application_Json_Lines_Response()
"application/jsonl");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.VariableBatchRequest(
var operationRequest = new VariableBatchRequest(
"{ number }",
variables:
[
Expand Down Expand Up @@ -1420,7 +1426,7 @@ public async Task ReadAsResultStream_Multi_Application_Json_Lines_Response()
"application/jsonl");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.VariableBatchRequest(
var operationRequest = new VariableBatchRequest(
"{ number }",
variables:
[
Expand Down Expand Up @@ -1470,7 +1476,7 @@ public async Task ReadAsResultStream_Single_Text_Event_Stream_Response()
"text/event-stream");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.OperationRequest("{ number }");
var operationRequest = new OperationRequest("{ number }");
var request = new GraphQLHttpRequest(operationRequest, new Uri("http://localhost:5000/graphql"));

// act
Expand Down Expand Up @@ -1519,7 +1525,7 @@ public async Task ReadAsResultStream_Multi_Text_Event_Stream_Response()
"text/event-stream");
using var client = new DefaultGraphQLHttpClient(new HttpClient(handler));

var operationRequest = new HotChocolate.Transport.OperationRequest("{ number }");
var operationRequest = new OperationRequest("{ number }");
var request = new GraphQLHttpRequest(operationRequest, new Uri("http://localhost:5000/graphql"));

// act
Expand Down Expand Up @@ -1552,7 +1558,7 @@ protected override Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request,
CancellationToken cancellationToken)
{
var response = new HttpResponseMessage(System.Net.HttpStatusCode.OK)
var response = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StreamContent(responseStream)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async ValueTask InvokeAsync(RequestContext context)
catch (GraphQLException ex)
{
var errors = _errorHandler.Handle(ex.Errors);
context.Result = OperationResult.FromError([..errors]);
context.Result = OperationResult.FromError([.. errors]);
_diagnosticEvents.RequestError(context, ex);
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/HexColorType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/HslaType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/IPv4Type.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/IPv6Type.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/IsbnType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/MacAddressType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/PhoneNumberType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/RgbType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types.Scalars/RgbaType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using HotChocolate.Language;

namespace HotChocolate.Types;

Expand Down
2 changes: 1 addition & 1 deletion src/HotChocolate/Core/src/Types.Scalars/UtcOffsetType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static bool TrySerialize(
[NotNullWhen(true)] out string? result)
=> s_timeSpanToOffset.TryGetValue(value, out result);

public static bool TryDeserialize( string value, out TimeSpan result)
public static bool TryDeserialize(string value, out TimeSpan result)
=> s_offsetToTimeSpan.TryGetValue(value, out result);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Microsoft.Extensions.DependencyInjection;

namespace HotChocolate.Execution.Configuration;

internal class DefaultRequestExecutorBuilder : IRequestExecutorBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Microsoft.Extensions.DependencyInjection;

namespace HotChocolate.Execution.Configuration;

public delegate void OnConfigureSchemaServices(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using HotChocolate;
using HotChocolate.Execution;
using HotChocolate.Execution.Instrumentation;
using HotChocolate.Execution.Processing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static IRequestExecutorBuilder AddErrorFilter(
/// The <see cref="IServiceProvider"/> passed to the <paramref name="factory"/>
/// is for the schema services. If you need to access application services
/// you need to either make the services available in the schema services
/// via <see cref="RequestExecutorBuilderExtensions.AddApplicationService"/> or use
/// via <see cref="AddApplicationService"/> or use
/// <see cref="ExecutionServiceProviderExtensions.GetRootServiceProvider(IServiceProvider)"/>
/// to access the application services from within the schema service provider.
/// </remarks>
Expand Down Expand Up @@ -83,7 +83,7 @@ public static IRequestExecutorBuilder AddErrorFilter<T>(
/// <remarks>
/// The <typeparamref name="T"/> will be activated with the <see cref="IServiceProvider"/> of the schema services.
/// If your <typeparamref name="T"/> needs to access application services you need to
/// make the services available in the schema services via <see cref="RequestExecutorBuilderExtensions.AddApplicationService"/>.
/// make the services available in the schema services via <see cref="AddApplicationService"/>.
/// </remarks>
public static IRequestExecutorBuilder AddErrorFilter<T>(
this IRequestExecutorBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static partial class RequestExecutorBuilderExtensions
/// <remarks>
/// The <typeparamref name="T"/> will be activated with the <see cref="IServiceProvider"/> of the schema services.
/// If your <typeparamref name="T"/> needs to access application services you need to
/// make the services available in the schema services via <see cref="RequestExecutorBuilderExtensions.AddApplicationService"/>.
/// make the services available in the schema services via <see cref="AddApplicationService"/>.
/// </remarks>
public static IRequestExecutorBuilder AddOperationCompilerOptimizer<T>(
this IRequestExecutorBuilder builder)
Expand Down Expand Up @@ -52,7 +52,7 @@ public static IRequestExecutorBuilder AddOperationCompilerOptimizer<T>(
/// The <see cref="IServiceProvider"/> passed to the <paramref name="factory"/>
/// is for the schema services. If you need to access application services
/// you need to either make the services available in the schema services
/// via <see cref="RequestExecutorBuilderExtensions.AddApplicationService"/> or use
/// via <see cref="AddApplicationService"/> or use
/// <see cref="ExecutionServiceProviderExtensions.GetRootServiceProvider(IServiceProvider)"/>
/// to access the application services from within the schema service provider.
/// </remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static partial class RequestExecutorBuilderExtensions
/// <remarks>
/// The <typeparamref name="T"/> will be activated with the <see cref="IServiceProvider"/> of the schema services.
/// If your <typeparamref name="T"/> needs to access application services you need to
/// make the services available in the schema services via <see cref="RequestExecutorBuilderExtensions.AddApplicationService"/>.
/// make the services available in the schema services via <see cref="AddApplicationService"/>.
/// </remarks>
public static IRequestExecutorBuilder AddTransactionScopeHandler<T>(
this IRequestExecutorBuilder builder)
Expand Down Expand Up @@ -62,7 +62,7 @@ public static IRequestExecutorBuilder AddTransactionScopeHandler<T>(
/// The <see cref="IServiceProvider"/> passed to the <paramref name="factory"/>
/// is for the schema services. If you need to access application services
/// you need to either make the services available in the schema services
/// via <see cref="RequestExecutorBuilderExtensions.AddApplicationService"/> or use
/// via <see cref="AddApplicationService"/> or use
/// <see cref="ExecutionServiceProviderExtensions.GetRootServiceProvider(IServiceProvider)"/>
/// to access the application services from within the schema service provider.
/// </remarks>
Expand Down
Loading
Loading