-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from Avinya-Foundation/rukmal-update
Add internal graphQL tests and update avinya types
- Loading branch information
Showing
6 changed files
with
75 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import ballerina/test; | ||
import ballerina/graphql; | ||
|
||
graphql:Client test_client = check new ("http://localhost:4000/graphql"); | ||
|
||
@test:Config {} | ||
public function testGetProvince() { | ||
// Attempt to get geo information for Dehiwala | ||
json|error? a = test_client->executeWithType(string ` | ||
query test($name:String!) { | ||
geo { | ||
city(name: $name) { | ||
name {name_en} | ||
district { | ||
name {name_en} | ||
province { | ||
name {name_en} | ||
} | ||
} | ||
} | ||
} | ||
}`, | ||
{"name": "Dehiwala"}); | ||
|
||
// Verify output | ||
test:assertEquals(a, | ||
{ | ||
"data": { | ||
"geo": { | ||
"city": { | ||
"name": {"name_en": "Dehiwala"}, | ||
"district": { | ||
"name": {"name_en": "Colombo"}, | ||
"province": {"name": {"name_en": "Western"}} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters