Skip to content

Commit

Permalink
Fixed compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Sep 12, 2022
1 parent 5c822d4 commit deec15d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ private static async ValueTask WriteNewLineAndFlushAsync(
Stream outputStream,
CancellationToken ct)
{
#if NETCOREAPP3_1_OR_GREATER
await outputStream.WriteAsync(_newLine, ct).ConfigureAwait(false);
#else
await outputStream.WriteAsync(_newLine, 0, _newLine.Length, ct).ConfigureAwait(false);
#endif
await outputStream.FlushAsync(ct);
}
}
14 changes: 6 additions & 8 deletions src/HotChocolate/Core/test/Types.Tests/SchemaErrorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public void CreateSchemaError_AddSyntaxNode()
var message = "FooBar";
var node = new NameNode("foo");


// act
var schemaError = SchemaErrorBuilder.New()
.SetMessage(message)
Expand Down Expand Up @@ -158,12 +157,11 @@ public void IncorrectType_In_Parameters_ShouldThrow()
{
// arrange
var schema = SchemaBuilder.New()
.AddDocumentFromString(@"
type Query {
test(bar: Input123): String
}
")
.Use(next => context => default);
.AddDocumentFromString(
@"type Query {
test(bar: Input123): String
}")
.Use(_ => _ => default);

// act
var ex = Assert.Throws<SchemaException>(() => schema.Create());
Expand All @@ -175,7 +173,7 @@ type Query {

private sealed class ErrorInterceptor : SchemaInterceptor
{
public List<Exception> Exceptions { get; } = new List<Exception>();
public List<Exception> Exceptions { get; } = new();

public override void OnError(IDescriptorContext context, Exception exception)
{
Expand Down

0 comments on commit deec15d

Please sign in to comment.