Skip to content

Commit

Permalink
Fixed typos and formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Jan 30, 2023
1 parent 1c10875 commit 73e1cde
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/HotChocolate/Core/src/Abstractions/ServiceKind.cs
Expand Up @@ -16,7 +16,7 @@ public enum ServiceKind
Default,

/// <summary>
/// The service will will be retrieved from the <see cref="IServiceProvider" />
/// The service will be retrieved from the <see cref="IServiceProvider" />
/// but can only accessed by a single resolver at a time.
/// Example for such service is for instance the Entity
/// Framework DbContext when scoped on the request.
Expand Down
Expand Up @@ -24,8 +24,8 @@ namespace HotChocolate.Execution;

internal sealed class RequestExecutorResolver
: IRequestExecutorResolver
, IInternalRequestExecutorResolver
, IDisposable
, IInternalRequestExecutorResolver
, IDisposable
{
private readonly SemaphoreSlim _semaphore = new(1, 1);
private readonly ConcurrentDictionary<string, RegisteredExecutor> _executors = new();
Expand Down
2 changes: 1 addition & 1 deletion src/HotChocolate/Core/src/Subscriptions/TopicFormatter.cs
Expand Up @@ -19,7 +19,7 @@ public TopicFormatter(string? prefix)

public string Format(string topic)
{
var length = checked(1 + topic.Length * 4 + _prefix.Length);
var length = checked(1 + (topic.Length * 4) + _prefix.Length);
byte[]? topicBuffer = null;

var topicSpan = length <= 256
Expand Down
Expand Up @@ -12,7 +12,7 @@ namespace HotChocolate.Resolvers.Expressions.Parameters;

/// <summary>
/// The service helper configures the object fields with middleware to handle
/// various service behaviours like pooled services.
/// various service behaviors like pooled services.
/// </summary>
internal static class ServiceHelper
{
Expand Down
Expand Up @@ -17,10 +17,11 @@
namespace HotChocolate.Types.Descriptors;

/// <summary>
/// <para>
/// The descriptor context is passed around during the schema creation and
/// allows access to conventions and context data.
///
/// Essentially this is the schema building context.
/// </para>
/// <para>Essentially this is the schema building context.</para>
/// </summary>
public sealed class DescriptorContext : IDescriptorContext
{
Expand Down
12 changes: 6 additions & 6 deletions src/HotChocolate/Core/src/Validation/DocumentValidator.cs
Expand Up @@ -18,7 +18,7 @@ public sealed class DocumentValidator : IDocumentValidator
{
private readonly DocumentValidatorContextPool _contextPool;
private readonly IDocumentValidatorRule[] _allRules;
private readonly IDocumentValidatorRule[] _nonCacheableRules;
private readonly IDocumentValidatorRule[] _nonCashableRules;
private readonly IValidationResultAggregator[] _aggregators;
private readonly int _maxAllowedErrors;

Expand Down Expand Up @@ -55,21 +55,21 @@ public sealed class DocumentValidator : IDocumentValidator

_contextPool = contextPool ?? throw new ArgumentNullException(nameof(contextPool));
_allRules = rules.ToArray();
_nonCacheableRules = _allRules.Where(t => !t.IsCacheable).ToArray();
_nonCashableRules = _allRules.Where(t => !t.IsCacheable).ToArray();
_aggregators = resultAggregators.ToArray();
_maxAllowedErrors = errorOptions.MaxAllowedErrors;
}

/// <inheritdoc />
public bool HasDynamicRules => _nonCacheableRules.Length > 0 || _aggregators.Length > 0;
public bool HasDynamicRules => _nonCashableRules.Length > 0 || _aggregators.Length > 0;

/// <inheritdoc />
public ValueTask<DocumentValidatorResult> ValidateAsync(
ISchema schema,
DocumentNode document,
string documentId,
IDictionary<string, object?> contextData,
bool onlyNonCacheable,
bool onlyNonCashable,
CancellationToken cancellationToken = default)
{
if (schema is null)
Expand All @@ -87,13 +87,13 @@ public sealed class DocumentValidator : IDocumentValidator
throw new ArgumentNullException(nameof(documentId));
}

if (onlyNonCacheable && _nonCacheableRules.Length == 0 && _aggregators.Length == 0)
if (onlyNonCashable && _nonCashableRules.Length == 0 && _aggregators.Length == 0)
{
return new(DocumentValidatorResult.Ok);
}

var context = _contextPool.Get();
var rules = onlyNonCacheable ? _nonCacheableRules : _allRules;
var rules = onlyNonCashable ? _nonCashableRules : _allRules;
var handleCleanup = true;

try
Expand Down

0 comments on commit 73e1cde

Please sign in to comment.