Skip to content

Commit db50286

Browse files
committed
Merged Main
2 parents cee5226 + 4c85246 commit db50286

File tree

114 files changed

+841
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+841
-450
lines changed

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: ChilliCream Community Support
4-
url: https://bit.ly/join-chillicream-slack
4+
url: http://slack.chillicream.com/
55
about: Join us on slack! We have a vibrant community that is helping each other.
66
- name: ChilliCream Enterprise Support
77
url: https://chillicream.com/support

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ One of the easiest ways to contribute is to participate in discussions on GitHub
44

55
## General feedback and discussions?
66

7-
Start a discussion on the [repository issue tracker](https://github.com/ChilliCream/hotchocolate/issues) or [join us on slack](https://bit.ly/joinchilli).
7+
Start a discussion on the [repository issue tracker](https://github.com/ChilliCream/hotchocolate/issues) or [join us on slack](http://slack.chillicream.com/).
88

99
## Bugs and feature requests?
1010

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![NuGet Package](https://img.shields.io/nuget/v/hotchocolate.svg)](https://www.nuget.org/packages/HotChocolate/)
44
[![License](https://img.shields.io/github/license/ChilliCream/hotchocolate.svg)](https://github.com/ChilliCream/hotchocolate/blob/main/LICENSE)
55
[![Coverage Status](https://sonarcloud.io/api/project_badges/measure?project=HotChocolate&metric=coverage)](https://sonarcloud.io/dashboard?id=HotChocolate)
6-
[![Slack channel](https://img.shields.io/badge/join%20the%20community-on%20slack-blue.svg)](https://bit.ly/join-chillicream-slack)
6+
[![Slack channel](https://img.shields.io/badge/join%20the%20community-on%20slack-blue.svg)](http://slack.chillicream.com/)
77
[![Twitter](https://img.shields.io/badge/join%20us-on%20twitter-green.svg)](https://twitter.com/chilli_cream)
88

99
---

src/GreenDonut/src/Core/PublicAPI.Unshipped.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ GreenDonut.GroupedDataLoader<TKey, TValue>.GroupedDataLoader(GreenDonut.IBatchSc
1313
override sealed GreenDonut.BatchDataLoader<TKey, TValue>.FetchAsync(System.Collections.Generic.IReadOnlyList<TKey>! keys, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyList<GreenDonut.Result<TValue>>!>
1414
override sealed GreenDonut.CacheDataLoader<TKey, TValue>.FetchAsync(System.Collections.Generic.IReadOnlyList<TKey>! keys, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyList<GreenDonut.Result<TValue>>!>
1515
override sealed GreenDonut.GroupedDataLoader<TKey, TValue>.FetchAsync(System.Collections.Generic.IReadOnlyList<TKey>! keys, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyList<GreenDonut.Result<TValue[]!>>!>
16-
static GreenDonut.AutoBatchScheduler.Default.get -> GreenDonut.AutoBatchScheduler!
16+
static GreenDonut.AutoBatchScheduler.Default.get -> GreenDonut.AutoBatchScheduler!
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
*REMOVED*HotChocolate.AuthorizeSchemaConfigurationExtensions
2-
*REMOVED*static HotChocolate.AuthorizeSchemaConfigurationExtensions.RegisterAuthorizeDirectiveType(this HotChocolate.Configuration.ISchemaConfiguration! configuration) -> void
2+
*REMOVED*static HotChocolate.AuthorizeSchemaConfigurationExtensions.RegisterAuthorizeDirectiveType(this HotChocolate.Configuration.ISchemaConfiguration! configuration) -> void

src/HotChocolate/AspNetCore/src/AspNetCore/PublicAPI.Unshipped.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ HotChocolate.AspNetCore.ToolOptionsFileMiddleware.ToolOptionsFileMiddleware(Micr
44
static HotChocolate.AspNetCore.Subscriptions.WebSocketSession.New(Microsoft.AspNetCore.Http.HttpContext! httpContext, HotChocolate.AspNetCore.Subscriptions.IMessagePipeline! messagePipeline, HotChocolate.AspNetCore.ISocketSessionInterceptor! socketSessionInterceptor) -> HotChocolate.AspNetCore.Subscriptions.WebSocketSession!
55
*REMOVED*static HotChocolate.AspNetCore.Subscriptions.WebSocketSession.New(Microsoft.AspNetCore.Http.HttpContext! httpContext, HotChocolate.AspNetCore.Subscriptions.IMessagePipeline! messagePipeline) -> HotChocolate.AspNetCore.Subscriptions.WebSocketSession!
66
static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapBananaCakePop(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpointRouteBuilder, string! toolPath = "/graphql/ui", string! requestPath = "/graphql") -> HotChocolate.AspNetCore.Extensions.GraphQLEndpointConventionBuilder!
7-
*REMOVED*HotChocolate.AspNetCore.ToolOptionsFileMiddleware.ToolOptionsFileMiddleware(Microsoft.AspNetCore.Http.RequestDelegate! next, HotChocolate.Execution.IRequestExecutorResolver! executorResolver, HotChocolate.AspNetCore.Serialization.IHttpResultSerializer! resultSerializer, HotChocolate.NameString schemaName, Microsoft.AspNetCore.Http.PathString matchUrl) -> void
7+
*REMOVED*HotChocolate.AspNetCore.ToolOptionsFileMiddleware.ToolOptionsFileMiddleware(Microsoft.AspNetCore.Http.RequestDelegate! next, HotChocolate.Execution.IRequestExecutorResolver! executorResolver, HotChocolate.AspNetCore.Serialization.IHttpResultSerializer! resultSerializer, HotChocolate.NameString schemaName, Microsoft.AspNetCore.Http.PathString matchUrl) -> void

src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/DefaultMessagePipeline.cs

+14-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.Generic;
44
using System.Diagnostics.CodeAnalysis;
55
using System.Linq;
6+
using System.Net.WebSockets;
67
using System.Threading;
78
using System.Threading.Tasks;
89
using HotChocolate.AspNetCore.Subscriptions.Messages;
@@ -30,15 +31,22 @@ public async Task ProcessAsync(
3031
ReadOnlySequence<byte> slice,
3132
CancellationToken cancellationToken)
3233
{
33-
if (TryParseMessage(slice, out OperationMessage? message))
34+
try
3435
{
35-
await HandleMessageAsync(connection, message, cancellationToken);
36+
if (TryParseMessage(slice, out OperationMessage? message))
37+
{
38+
await HandleMessageAsync(connection, message, cancellationToken);
39+
}
40+
else
41+
{
42+
await connection.SendAsync(
43+
KeepConnectionAliveMessage.Default,
44+
CancellationToken.None);
45+
}
3646
}
37-
else
47+
catch (WebSocketException)
3848
{
39-
await connection.SendAsync(
40-
KeepConnectionAliveMessage.Default,
41-
CancellationToken.None);
49+
// we will just stop receiving
4250
}
4351
}
4452

src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/KeepConnectionAliveJob.cs

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Net.WebSockets;
23
using System.Threading;
34
using System.Threading.Tasks;
45
using HotChocolate.AspNetCore.Subscriptions.Messages;
@@ -52,6 +53,10 @@ await _connection.SendAsync(
5253
{
5354
// the message processing was canceled.
5455
}
56+
catch (WebSocketException)
57+
{
58+
// we will just stop receiving
59+
}
5560
}
5661
}
5762
}

src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/MessageProcessor.cs

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Buffers;
33
using System.IO.Pipelines;
4+
using System.Net.WebSockets;
45
using System.Threading;
56
using System.Threading.Tasks;
67

@@ -67,6 +68,10 @@ await _pipeline.ProcessAsync(
6768
}
6869
}
6970
catch(OperationCanceledException) when (cancellationToken.IsCancellationRequested) { }
71+
catch (WebSocketException)
72+
{
73+
// we will just stop receiving
74+
}
7075
finally
7176
{
7277
// reader should be completed always, so that related pipe writer can

src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/WebSocketConnection.cs

+11-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public Task SendAsync(
6363
{
6464
WebSocket? webSocket = _webSocket;
6565

66-
if (_disposed || webSocket == null)
66+
if (_disposed || webSocket == null || webSocket.State != WebSocketState.Open)
6767
{
6868
return Task.CompletedTask;
6969
}
@@ -95,6 +95,11 @@ public async Task ReceiveAsync(
9595

9696
if (success)
9797
{
98+
if (webSocket.State != WebSocketState.Open)
99+
{
100+
break;
101+
}
102+
98103
try
99104
{
100105
socketResult = await webSocket.ReceiveAsync(buffer, cancellationToken);
@@ -122,6 +127,10 @@ public async Task ReceiveAsync(
122127
{
123128
// we will just stop receiving
124129
}
130+
catch (WebSocketException)
131+
{
132+
// we will just stop receiving
133+
}
125134
}
126135

127136
public async Task CloseAsync(
@@ -133,7 +142,7 @@ public async Task CloseAsync(
133142
{
134143
WebSocket? webSocket = _webSocket;
135144

136-
if (_disposed || Closed || webSocket is null)
145+
if (_disposed || Closed || webSocket is null || webSocket.State != WebSocketState.Open)
137146
{
138147
return;
139148
}

src/HotChocolate/Core/src/Execution/PublicAPI.Unshipped.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ virtual HotChocolate.Execution.Instrumentation.DiagnosticEventListener.StopProce
118118
*REMOVED*static Microsoft.Extensions.DependencyInjection.SchemaRequestExecutorBuilderExtensions.AddResolver(this HotChocolate.Execution.Configuration.IRequestExecutorBuilder! builder, HotChocolate.Resolvers.FieldResolver! fieldResolver) -> HotChocolate.Execution.Configuration.IRequestExecutorBuilder!
119119
*REMOVED*static HotChocolate.Execution.Processing.OperationCompiler.Compile(string! operationId, HotChocolate.Language.DocumentNode! document, HotChocolate.Language.OperationDefinitionNode! operation, HotChocolate.ISchema! schema, HotChocolate.Types.ObjectType! rootType, System.Collections.Generic.IEnumerable<HotChocolate.Execution.Processing.ISelectionOptimizer!>? optimizers = null) -> HotChocolate.Execution.Processing.IPreparedOperation!
120120
*REMOVED*static Microsoft.Extensions.DependencyInjection.SchemaRequestExecutorBuilderExtensions.AddConvention<TConvetion, TConcreteConvention>(this HotChocolate.Execution.Configuration.IRequestExecutorBuilder! builder, string? scope = null) -> HotChocolate.Execution.Configuration.IRequestExecutorBuilder!
121-
*REMOVED*static HotChocolate.Execution.Processing.VariableRewriter.Rewrite(HotChocolate.Language.IValueNode! node, HotChocolate.Execution.IVariableValueCollection! variableValues) -> HotChocolate.Language.IValueNode!
121+
*REMOVED*static HotChocolate.Execution.Processing.VariableRewriter.Rewrite(HotChocolate.Language.IValueNode! node, HotChocolate.Execution.IVariableValueCollection! variableValues) -> HotChocolate.Language.IValueNode!

src/HotChocolate/Core/src/Types.CursorPagination/Extensions/UsePagingAttribute.cs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public sealed class UsePagingAttribute : DescriptorAttribute
1717
private bool? _allowBackwardPagination;
1818
private bool? _requirePagingBoundaries;
1919
private bool? _inferConnectionNameFromField;
20-
private NameString _name;
2120

2221
/// <summary>
2322
/// Applies the offset paging middleware to the annotated property.

src/HotChocolate/Core/src/Types.CursorPagination/PublicAPI.Shipped.txt

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ HotChocolate.Types.Pagination.QueryableCursorPagingProvider
5757
HotChocolate.Types.Pagination.QueryableCursorPagingProvider.QueryableCursorPagingProvider() -> void
5858
HotChocolate.Types.PagingObjectFieldDescriptorExtensions
5959
HotChocolate.Types.UsePagingAttribute
60+
HotChocolate.Types.UsePagingAttribute.AllowBackwardPagination.get -> bool
61+
HotChocolate.Types.UsePagingAttribute.AllowBackwardPagination.set -> void
6062
HotChocolate.Types.UsePagingAttribute.DefaultPageSize.get -> int
6163
HotChocolate.Types.UsePagingAttribute.DefaultPageSize.set -> void
6264
HotChocolate.Types.UsePagingAttribute.IncludeTotalCount.get -> bool
@@ -76,7 +78,9 @@ static HotChocolate.Types.EnumerableCursorPagingExtensions.ApplyCursorPagination
7678
static HotChocolate.Types.Pagination.CursorPagingHelper.ApplyPagination<TSource, TEntity>(TSource source, HotChocolate.Types.Pagination.CursorPagingArguments arguments, HotChocolate.Types.Pagination.CursorPagingHelper.ApplySkip<TSource>! applySkip, HotChocolate.Types.Pagination.CursorPagingHelper.ApplyTake<TSource>! applyTake, HotChocolate.Types.Pagination.CursorPagingHelper.ToIndexEdgesAsync<TSource, TEntity>! toIndexEdgesAsync, HotChocolate.Types.Pagination.CursorPagingHelper.CountAsync<TSource>! countAsync, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask<HotChocolate.Types.Pagination.Connection!>
7779
static HotChocolate.Types.Pagination.IndexEdge<T>.Create(T node, int index) -> HotChocolate.Types.Pagination.IndexEdge<T>!
7880
static HotChocolate.Types.Pagination.IndexEdge<T>.DeserializeCursor(string! cursor) -> int
81+
static HotChocolate.Types.PagingObjectFieldDescriptorExtensions.AddPagingArguments(this HotChocolate.Types.IInterfaceFieldDescriptor! descriptor, bool allowBackwardPagination) -> HotChocolate.Types.IInterfaceFieldDescriptor!
7982
static HotChocolate.Types.PagingObjectFieldDescriptorExtensions.AddPagingArguments(this HotChocolate.Types.IInterfaceFieldDescriptor! descriptor) -> HotChocolate.Types.IInterfaceFieldDescriptor!
83+
static HotChocolate.Types.PagingObjectFieldDescriptorExtensions.AddPagingArguments(this HotChocolate.Types.IObjectFieldDescriptor! descriptor, bool allowBackwardPagination) -> HotChocolate.Types.IObjectFieldDescriptor!
8084
static HotChocolate.Types.PagingObjectFieldDescriptorExtensions.AddPagingArguments(this HotChocolate.Types.IObjectFieldDescriptor! descriptor) -> HotChocolate.Types.IObjectFieldDescriptor!
8185
virtual HotChocolate.Types.Pagination.QueryableCursorPagingHandler<TEntity>.ApplyCursorToEdges(System.Linq.IQueryable<TEntity>! allEdges, int? after, int? before) -> System.Linq.IQueryable<TEntity>!
8286
virtual HotChocolate.Types.Pagination.QueryableCursorPagingHandler<TEntity>.ExecuteQueryableAsync(System.Linq.IQueryable<TEntity>! queryable, int offset, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyList<HotChocolate.Types.Pagination.IndexEdge<TEntity>!>!>

src/HotChocolate/Core/src/Types/PublicAPI.Shipped.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,7 @@ const HotChocolate.Types.Introspection.__AppliedDirective.Names.Name = "name" ->
11431143
const HotChocolate.Types.Introspection.__DirectiveArgument.Names.__DirectiveArgument = "__DirectiveArgument" -> string!
11441144
const HotChocolate.Types.Introspection.__DirectiveArgument.Names.Name = "name" -> string!
11451145
const HotChocolate.Types.Introspection.__DirectiveArgument.Names.Value = "value" -> string!
1146+
const HotChocolate.Types.Pagination.PagingDefaults.AllowBackwardPagination = true -> bool
11461147
const HotChocolate.Types.Pagination.PagingDefaults.DefaultPageSize = 10 -> int
11471148
const HotChocolate.Types.Pagination.PagingDefaults.IncludeTotalCount = false -> bool
11481149
const HotChocolate.Types.Pagination.PagingDefaults.MaxPageSize = 50 -> int
@@ -2295,6 +2296,7 @@ HotChocolate.Types.IDescriptorExtension.OnBeforeCreate(System.Action<HotChocolat
22952296
HotChocolate.Types.IDescriptorExtension.OnBeforeCreate(System.Action<HotChocolate.Types.Descriptors.IDescriptorContext!, HotChocolate.Types.Descriptors.Definitions.DefinitionBase!>! configure) -> void
22962297
HotChocolate.Types.IDescriptorExtension.OnBeforeNaming(System.Action<HotChocolate.Configuration.ITypeCompletionContext!, HotChocolate.Types.Descriptors.Definitions.DefinitionBase!>! configure) -> HotChocolate.Types.INamedDependencyDescriptor!
22972298
HotChocolate.Types.IDescriptorExtension<T>
2299+
HotChocolate.Types.IDescriptorExtension<T>.Definition.get -> T!
22982300
HotChocolate.Types.IDescriptorExtension<T>.OnBeforeCompletion(System.Action<HotChocolate.Configuration.ITypeCompletionContext!, T!>! configure) -> HotChocolate.Types.ICompletedDependencyDescriptor!
22992301
HotChocolate.Types.IDescriptorExtension<T>.OnBeforeCreate(System.Action<HotChocolate.Types.Descriptors.IDescriptorContext!, T!>! configure) -> void
23002302
HotChocolate.Types.IDescriptorExtension<T>.OnBeforeCreate(System.Action<T!>! configure) -> void
@@ -2673,6 +2675,8 @@ HotChocolate.Types.Pagination.PagingMiddleware
26732675
HotChocolate.Types.Pagination.PagingMiddleware.InvokeAsync(HotChocolate.Resolvers.IMiddlewareContext! context) -> System.Threading.Tasks.Task!
26742676
HotChocolate.Types.Pagination.PagingMiddleware.PagingMiddleware(HotChocolate.Resolvers.FieldDelegate! next, HotChocolate.Types.Pagination.IPagingHandler! pagingHandler) -> void
26752677
HotChocolate.Types.Pagination.PagingOptions
2678+
HotChocolate.Types.Pagination.PagingOptions.AllowBackwardPagination.get -> bool?
2679+
HotChocolate.Types.Pagination.PagingOptions.AllowBackwardPagination.set -> void
26762680
HotChocolate.Types.Pagination.PagingOptions.DefaultPageSize.get -> int?
26772681
HotChocolate.Types.Pagination.PagingOptions.DefaultPageSize.set -> void
26782682
HotChocolate.Types.Pagination.PagingOptions.IncludeTotalCount.get -> bool?

src/HotChocolate/Core/src/Validation/PublicAPI.Unshipped.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ static Microsoft.Extensions.DependencyInjection.HotChocolateValidationBuilderExt
4444
static Microsoft.Extensions.DependencyInjection.HotChocolateValidationBuilderExtensions.TryAddValidationVisitor<T>(this HotChocolate.Validation.Options.IValidationBuilder! builder, System.Func<System.IServiceProvider!, HotChocolate.Validation.Options.ValidationOptions!, T!>! factory, bool isCacheable = true) -> HotChocolate.Validation.Options.IValidationBuilder!
4545
*REMOVED*HotChocolate.Validation.DocumentValidatorRule<TVisitor>.DocumentValidatorRule(TVisitor! visitor) -> void
4646
*REMOVED*static Microsoft.Extensions.DependencyInjection.HotChocolateValidationBuilderExtensions.TryAddValidationVisitor<T>(this HotChocolate.Validation.Options.IValidationBuilder! builder, System.Func<System.IServiceProvider!, HotChocolate.Validation.Options.ValidationOptions!, T!>! factory) -> HotChocolate.Validation.Options.IValidationBuilder!
47-
*REMOVED*static Microsoft.Extensions.DependencyInjection.HotChocolateValidationBuilderExtensions.TryAddValidationVisitor<T>(this HotChocolate.Validation.Options.IValidationBuilder! builder) -> HotChocolate.Validation.Options.IValidationBuilder!
47+
*REMOVED*static Microsoft.Extensions.DependencyInjection.HotChocolateValidationBuilderExtensions.TryAddValidationVisitor<T>(this HotChocolate.Validation.Options.IValidationBuilder! builder) -> HotChocolate.Validation.Options.IValidationBuilder!

src/HotChocolate/Data/src/Data/PublicAPI.Unshipped.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ virtual HotChocolate.Data.Projections.SelectionVisitor<TContext>.VisitObjectType
9191
*REMOVED*override HotChocolate.Data.Sorting.SortInputType.OnCompleteFields(HotChocolate.Configuration.ITypeCompletionContext! context, HotChocolate.Types.Descriptors.Definitions.InputObjectTypeDefinition! definition, System.Collections.Generic.ICollection<HotChocolate.Types.InputField!>! fields) -> void
9292
*REMOVED*override HotChocolate.Data.Sorting.SortTypeInterceptor.OnBeforeCompleteName(HotChocolate.Configuration.ITypeCompletionContext! completionContext, HotChocolate.Types.Descriptors.Definitions.DefinitionBase! definition, System.Collections.Generic.IDictionary<string!, object!>! contextData) -> void
9393
*REMOVED*override HotChocolate.Data.Sorting.SortTypeInterceptor.OnBeforeRegisterDependencies(HotChocolate.Configuration.ITypeDiscoveryContext! discoveryContext, HotChocolate.Types.Descriptors.Definitions.DefinitionBase! definition, System.Collections.Generic.IDictionary<string!, object!>! contextData) -> void
94-
*REMOVED*virtual HotChocolate.Data.Filters.FilterOperationHandler<TContext, T>.TryHandleOperation(TContext! context, HotChocolate.Data.Filters.IFilterOperationField! field, HotChocolate.Language.ObjectFieldNode! node, out T result) -> bool
94+
*REMOVED*virtual HotChocolate.Data.Filters.FilterOperationHandler<TContext, T>.TryHandleOperation(TContext! context, HotChocolate.Data.Filters.IFilterOperationField! field, HotChocolate.Language.ObjectFieldNode! node, out T result) -> bool

0 commit comments

Comments
 (0)