@@ -9,32 +9,28 @@ public class GraphQLClientPostTests : BaseGraphQLClientTest {
99
1010 [ Fact ]
1111 public async void QueryPostAsyncFact ( ) {
12- var graphQLRequest = new GraphQLRequest {
13- Query = @"
12+ var graphQLRequest = new GraphQLRequest ( @"
1413 {
1514 person(personID: ""1"") {
1615 name
1716 }
1817 }"
19- } ;
18+ ) ;
2019 var response = await this . GraphQLClient . PostAsync ( graphQLRequest ) . ConfigureAwait ( false ) ;
2120
2221 Assert . Equal ( "Luke Skywalker" , response . Data . person . name . Value ) ;
2322 Assert . Equal ( "Luke Skywalker" , response . GetDataFieldAs < Person > ( "person" ) . Name ) ;
2423 }
2524
2625 [ Fact ]
27- public async void QueryPostAsyncWithoutUtf8EncodingFact ( )
28- {
29- var graphQLRequest = new GraphQLRequest
30- {
31- Query = @"
26+ public async void QueryPostAsyncWithoutUtf8EncodingFact ( ) {
27+ var graphQLRequest = new GraphQLRequest ( @"
3228 {
3329 person(personID: ""1"") {
3430 name
3531 }
3632 }"
37- } ;
33+ ) ;
3834 this . GraphQLClient . Options . MediaType = MediaTypeHeaderValue . Parse ( "application/json" ) ;
3935 var response = await this . GraphQLClient . PostAsync ( graphQLRequest ) . ConfigureAwait ( false ) ;
4036
@@ -44,8 +40,7 @@ public async void QueryPostAsyncWithoutUtf8EncodingFact()
4440
4541 [ Fact ]
4642 public async void OperationNamePostAsyncFact ( ) {
47- var graphQLRequest = new GraphQLRequest {
48- Query = @"
43+ var graphQLRequest = new GraphQLRequest ( @"
4944 query Person{
5045 person(personID: ""1"") {
5146 name
@@ -56,7 +51,7 @@ query Planet {
5651 planet(planetID: ""1"") {
5752 name
5853 }
59- }" ,
54+ }" ) {
6055 OperationName = "Person"
6156 } ;
6257 var response = await this . GraphQLClient . PostAsync ( graphQLRequest ) . ConfigureAwait ( false ) ;
@@ -67,13 +62,12 @@ query Planet {
6762
6863 [ Fact ]
6964 public async void VariablesPostAsyncFact ( ) {
70- var graphQLRequest = new GraphQLRequest {
71- Query = @"
65+ var graphQLRequest = new GraphQLRequest ( @"
7266 query Person($personId: ID!){
7367 person(personID: $personId) {
7468 name
7569 }
76- }" ,
70+ }" ) {
7771 Variables = new {
7872 personId = "1"
7973 }
@@ -86,8 +80,7 @@ query Person($personId: ID!){
8680
8781 [ Fact ]
8882 public async void OperationNameVariablePostAsyncFact ( ) {
89- var graphQLRequest = new GraphQLRequest {
90- Query = @"
83+ var graphQLRequest = new GraphQLRequest ( @"
9184 query Person($personId: ID!){
9285 person(personID: $personId) {
9386 name
@@ -98,7 +91,7 @@ query Planet {
9891 planet(planetID: ""1"") {
9992 name
10093 }
101- }" ,
94+ }" ) {
10295 OperationName = "Person" ,
10396 Variables = new {
10497 personId = "1"
0 commit comments