Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Fragments Returning null Value for non-null Types #2184

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ballerina-tests/graphql-advanced-test-suite/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
org = "ballerina"
name = "graphql_advanced_test_suite"
version = "1.16.0"
version = "1.16.1"

[[dependency]]
org = "ballerina"
name = "graphql_test_common"
repository = "local"
version = "1.16.0"
version = "1.16.1"
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -105,7 +105,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_advanced_test_suite"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "graphql"},
Expand All @@ -123,7 +123,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "file"},
Expand Down
4 changes: 2 additions & 2 deletions ballerina-tests/graphql-client-test-suite/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
org = "ballerina"
name = "graphql_client_test_suite"
version = "1.16.0"
version = "1.16.1"

[[dependency]]
org = "ballerina"
name = "graphql_test_common"
repository = "local"
version = "1.16.0"
version = "1.16.1"
6 changes: 3 additions & 3 deletions ballerina-tests/graphql-client-test-suite/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -109,7 +109,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_client_test_suite"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "graphql"},
{org = "ballerina", name = "graphql_test_common"},
Expand All @@ -122,7 +122,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "file"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
org = "ballerina"
name = "graphql_dataloader_test_suite"
version = "1.16.0"
version = "1.16.1"

[[dependency]]
org = "ballerina"
name = "graphql_test_common"
repository = "local"
version = "1.16.0"
version = "1.16.1"
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -109,7 +109,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_dataloader_test_suite"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "graphql"},
{org = "ballerina", name = "graphql_test_common"},
Expand All @@ -124,7 +124,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "file"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
org = "ballerina"
name = "graphql_interceptor_test_suite"
version = "1.16.0"
version = "1.16.1"

[[dependency]]
org = "ballerina"
name = "graphql_test_common"
repository = "local"
version = "1.16.0"
version = "1.16.1"
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -109,7 +109,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_interceptor_test_suite"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "graphql"},
{org = "ballerina", name = "graphql_test_common"},
Expand All @@ -124,7 +124,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "file"},
Expand Down
4 changes: 2 additions & 2 deletions ballerina-tests/graphql-security-test-suite/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
org = "ballerina"
name = "graphql_security_test_suite"
version = "1.16.0"
version = "1.16.1"

[[dependency]]
org = "ballerina"
name = "graphql_test_common"
repository = "local"
version = "1.16.0"
version = "1.16.1"
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -109,7 +109,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_security_test_suite"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "graphql"},
{org = "ballerina", name = "graphql_test_common"},
Expand All @@ -123,7 +123,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "file"},
Expand Down
4 changes: 2 additions & 2 deletions ballerina-tests/graphql-service-test-suite/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
org = "ballerina"
name = "graphql_service_test_suite"
version = "1.16.0"
version = "1.16.1"

[[dependency]]
org = "ballerina"
name = "graphql_test_common"
repository = "local"
version = "1.16.0"
version = "1.16.1"
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -102,7 +102,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_service_test_suite"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "graphql"},
{org = "ballerina", name = "graphql_test_common"},
Expand All @@ -120,7 +120,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "file"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function dataProviderFragments() returns string[][] {
[url1, "unknown_inline_fragment"],
[url1, "invalid_spread_inline_fragments"],
[url3, "fragments_inside_fragments_when_returning_services"],
[url3, "nested_fragments_querying_service_objects_with_multiple_fields"]
[url3, "nested_fragments_querying_service_objects_with_multiple_fields"],
[url3, "fragments_returning_null_for_non_null_types"]
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ public isolated service class Vehicle {
return self.name;
}

isolated resource function get registeredYear() returns int|error {
isolated resource function get country() returns string|error {
return error("Country is not found");
}

isolated resource function get registeredYear() returns int?|error {
int? registeredYear = self.registeredYear;
if registeredYear == () {
return error("Registered Year is Not Found");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
allVehicles {
...Details
}
}

fragment Details on Vehicle {
name
country
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"errors": [
{
"message": "Country is not found",
"locations": [
{
"line": 9,
"column": 3
}
],
"path": ["allVehicles", 0,"country"]
},
{
"message": "Country is not found",
"locations": [
{
"line": 9,
"column": 3
}
],
"path": ["allVehicles", 1, "country"]
},
{
"message": "Country is not found",
"locations": [
{
"line": 9,
"column": 3
}
],
"path": ["allVehicles", 2, "country"]
}
],
"data":null
}
4 changes: 2 additions & 2 deletions ballerina-tests/graphql-subgraph-test-suite/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
org = "ballerina"
name = "graphql_subgraph_test_suite"
version = "1.16.0"
version = "1.16.1"

[[dependency]]
org = "ballerina"
name = "graphql_test_common"
repository = "local"
version = "1.16.0"
version = "1.16.1"
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -102,7 +102,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_subgraph_test_suite"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "graphql"},
{org = "ballerina", name = "graphql_test_common"},
Expand All @@ -115,7 +115,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "file"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
org = "ballerina"
name = "graphql_subscription_test_suite"
version = "1.16.0"
version = "1.16.1"

[[dependency]]
org = "ballerina"
name = "graphql_test_common"
repository = "local"
version = "1.16.0"
version = "1.16.1"
2 changes: 1 addition & 1 deletion ballerina-tests/graphql-test-common/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[package]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
4 changes: 2 additions & 2 deletions ballerina-tests/graphql-test-common/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -105,7 +105,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_test_common"
version = "1.16.0"
version = "1.16.1"
dependencies = [
{org = "ballerina", name = "file"},
{org = "ballerina", name = "graphql"},
Expand Down
Loading
Loading