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 @@ -264,6 +264,7 @@ private async Task<IExecutionResult> ExecuteQueryOrMutationAsync(
{
var queryType = context.Schema.QueryType;

// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (queryType is null)
{
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public async Task UseConnectionAttribute_Clamps_Default_Page_Size_To_Max_Page_Si
var operationResult = result.ExpectOperationResult();

Assert.True(
operationResult.Errors is null || operationResult.Errors.Count == 0,
operationResult.Errors.Count == 0,
$"Expected no errors but got: {operationResult.ToJson()}");

using var document = JsonDocument.Parse(operationResult.ToJson());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,7 @@ public static class ResolveWithStaticQueryResolver

public static Task<string> FooAsync() => Task.FromResult("Foo");

// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
public static Task<bool> BarAsync(IResolverContext context)
=> Task.FromResult(context is not null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ ... on Entity {
var operationResult = result.ExpectOperationResult();

Assert.True(
operationResult.Errors is null || operationResult.Errors.Count == 0,
operationResult.Errors.Count == 0,
$"Expected no errors but got: {operationResult.ToJson()}");

using var document = JsonDocument.Parse(operationResult.ToJson());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ ... on Foo {
var operationResult = result.ExpectOperationResult();

Assert.True(
operationResult.Errors is null || operationResult.Errors.Count == 0,
operationResult.Errors.Count == 0,
$"Expected no errors but got: {operationResult.ToJson()}");

using var document = JsonDocument.Parse(operationResult.ToJson());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ private static bool TryGetTopLevelProperty(
{
var current = expression;

// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
Comment thread
glen-84 marked this conversation as resolved.
while (current is not null)
{
current = UnwrapConvert(current);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ private static Path ParsePrefix(string pathPrefix)
/// </summary>
private static Path PopAfterValue(Path path)
{
if (path.Parent is not null && path is IndexerPathSegment indexer)
if (path is IndexerPathSegment indexer)
{
// Inside an array — advance to next index.
return path.Parent.Append(indexer.Index + 1);
}

if (path.Parent is not null && path is NamePathSegment)
if (path is NamePathSegment)
{
// Inside an object — pop the property name.
return path.Parent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ public void Reset()
// Return any pre-allocated chunks beyond the used range.
for (var i = usedChunks; i < _chunkCount; i++)
{
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
if (_chunks[i] is not null)
{
JsonMemory.Return(_memoryKind, _chunks[i]);
Comment thread
glen-84 marked this conversation as resolved.
Expand Down
5 changes: 1 addition & 4 deletions src/Mocha/src/Mocha/Runtime/MessagingRuntimeHostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ public async Task StartAsync(CancellationToken cancellationToken)

public async Task StopAsync(CancellationToken cancellationToken)
{
if (_runtime is not null)
{
await _runtime.DisposeAsync();
}
await _runtime.DisposeAsync();
}
}
Loading