@@ -21,7 +21,7 @@ struct HTTPTests {
2121 try await client. execute (
2222 uri: " /graphql " ,
2323 method: . post,
24- headers: defaultHeaders ,
24+ headers: jsonGraphQLHeaders ,
2525 body: . init( data: JSONEncoder ( ) . encode ( GraphQLRequest ( query: " { hello } " ) ) )
2626 ) { response in
2727 #expect( response. status == . ok)
@@ -65,7 +65,7 @@ struct HTTPTests {
6565 try await client. execute (
6666 uri: " /graphql " ,
6767 method: . post,
68- headers: defaultHeaders ,
68+ headers: jsonGraphQLHeaders ,
6969 body: . init( data: JSONEncoder ( ) . encode ( GraphQLRequest (
7070 query: " query Greet($name: String) { greet(name: $name) } " ,
7171 variables: [ " name " : " Alice " ]
@@ -113,7 +113,7 @@ struct HTTPTests {
113113 try await client. execute (
114114 uri: " /graphql " ,
115115 method: . post,
116- headers: defaultHeaders ,
116+ headers: jsonGraphQLHeaders ,
117117 body: . init( data: JSONEncoder ( ) . encode ( GraphQLRequest ( query: " { contextMessage } " ) ) )
118118 ) { response in
119119 #expect( response. status == . ok)
@@ -275,7 +275,7 @@ struct HTTPTests {
275275 try await client. execute (
276276 uri: " /graphql?query=%7Bhello%7D " ,
277277 method: . get,
278- headers: defaultHeaders
278+ headers: jsonGraphQLHeaders
279279 ) { response in
280280 #expect( response. status == . ok)
281281
@@ -302,7 +302,7 @@ struct HTTPTests {
302302 try await client. execute (
303303 uri: " /graphql?query=%7Bhello%7D " ,
304304 method: . get,
305- headers: defaultHeaders
305+ headers: jsonGraphQLHeaders
306306 ) { response in
307307 #expect( response. status == . methodNotAllowed)
308308 }
@@ -348,25 +348,4 @@ struct HTTPTests {
348348 }
349349 }
350350 }
351-
352- let defaultHeaders : HTTPFields = [
353- . accept: MediaType . applicationJsonGraphQL. description,
354- . contentType: MediaType . applicationJsonGraphQL. description,
355- ]
356-
357- let helloWorldSchema = try ! GraphQLSchema (
358- query: GraphQLObjectType (
359- name: " Query " ,
360- fields: [
361- " hello " : GraphQLField (
362- type: GraphQLString,
363- resolve: { _, _, _, _ in
364- " World "
365- }
366- ) ,
367- ]
368- )
369- )
370-
371- struct EmptyContext : Sendable { }
372351}
0 commit comments