Skip to content

Commit bc3bb87

Browse files
committed
Fix usage of obsolete method
1 parent b5dfa69 commit bc3bb87

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

src/GraphQL.Tests/Execution/SchemaLifetimeTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ public async Task ExecutingThenDisposing_DoesNotThrowException()
2121
var executer = new DocumentExecuter();
2222
var schema = new Schema();
2323

24-
await executer.ExecuteAsync(schema, null, "{noop}", null).ConfigureAwait(false);
24+
await executer.ExecuteAsync(_ =>
25+
{
26+
_.Schema = schema;
27+
_.Query = "{noop}";
28+
}).ConfigureAwait(false);
2529

2630
Should.NotThrow(() => schema.Dispose());
2731
}

src/GraphQL.Tests/Introspection/SchemaIntrospectionTests.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ public class SchemaIntrospectionTests
1212
public void validate_core_schema()
1313
{
1414
var documentExecuter = new DocumentExecuter();
15-
var executionResult = documentExecuter.ExecuteAsync(new Schema(), null, SchemaIntrospection.IntrospectionQuery, null).Result;
15+
var executionResult = documentExecuter.ExecuteAsync(_ =>
16+
{
17+
_.Schema = new Schema();
18+
_.Query = SchemaIntrospection.IntrospectionQuery;
19+
}).GetAwaiter().GetResult();
20+
1621
var json = new DocumentWriter(true).Write(executionResult.Data);
1722

1823
ShouldBe(json, IntrospectionResult.Data);
@@ -22,7 +27,12 @@ public void validate_core_schema()
2227
public void validate_non_null_schema()
2328
{
2429
var documentExecuter = new DocumentExecuter();
25-
var executionResult = documentExecuter.ExecuteAsync(new TestSchema(), null, InputObjectBugQuery, null).Result;
30+
var executionResult = documentExecuter.ExecuteAsync(_ =>
31+
{
32+
_.Schema = new TestSchema();
33+
_.Query = InputObjectBugQuery;
34+
}).GetAwaiter().GetResult();
35+
2636
var json = new DocumentWriter(true).Write(executionResult.Data);
2737
executionResult.Errors.ShouldBeNull();
2838

src/GraphQL/Execution/DocumentExecuter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace GraphQL
1919
{
2020
public interface IDocumentExecuter
2121
{
22-
[Obsolete("This method will be removed in a future version.")]
22+
[Obsolete("This method will be removed in a future version. Use ExecutionOptions parameter.")]
2323
Task<ExecutionResult> ExecuteAsync(
2424
ISchema schema,
2525
object root,
@@ -52,6 +52,7 @@ public DocumentExecuter(IDocumentBuilder documentBuilder, IDocumentValidator doc
5252
_complexityAnalyzer = complexityAnalyzer;
5353
}
5454

55+
[Obsolete("This method will be removed in a future version. Use ExecutionOptions parameter.")]
5556
public Task<ExecutionResult> ExecuteAsync(
5657
ISchema schema,
5758
object root,

0 commit comments

Comments
 (0)