File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Tests/GraphitiTests/HelloWorldTests Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,40 @@ class HelloWorldTests: XCTestCase {
343
343
wait ( for: [ expectation] , timeout: 10 )
344
344
}
345
345
346
+ func testInputRequest( ) throws {
347
+ let mutation = """
348
+ mutation addUser($user: UserInput!) {
349
+ addUser(user: $user) {
350
+ id,
351
+ name
352
+ }
353
+ }
354
+ """
355
+ let variables : [ String : Map ] = [ " user " : [ " id " : " 123 " , " name " : " bob " ] ]
356
+
357
+ let request = GraphQLRequest (
358
+ query: mutation,
359
+ variables: variables
360
+ )
361
+
362
+ let expected = GraphQLResult (
363
+ data: [ " addUser " : [ " id " : " 123 " , " name " : " bob " ] ]
364
+ )
365
+
366
+ let expectation = XCTestExpectation ( )
367
+
368
+ api. execute (
369
+ request: request,
370
+ context: api. context,
371
+ on: group
372
+ ) . whenSuccess { result in
373
+ XCTAssertEqual ( result, expected)
374
+ expectation. fulfill ( )
375
+ }
376
+
377
+ wait ( for: [ expectation] , timeout: 10 )
378
+ }
379
+
346
380
func testInputRecursive( ) throws {
347
381
let mutation = """
348
382
mutation addUser($user: UserInput!) {
You can’t perform that action at this time.
0 commit comments