-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add Input Value List Support for GraphQL #497
Add Input Value List Support for GraphQL #497
Conversation
…-ballerina-graphql into parser-validation-for-inputs
…-ballerina-graphql into parser-validation-for-inputs
Codecov Report
@@ Coverage Diff @@
## master #497 +/- ##
============================================
- Coverage 94.90% 94.59% -0.31%
- Complexity 297 335 +38
============================================
Files 54 53 -1
Lines 2981 3368 +387
Branches 1537 1748 +211
============================================
+ Hits 2829 3186 +357
- Misses 128 153 +25
- Partials 24 29 +5
Continue to review full report at Codecov.
|
compiler-plugin-tests/src/test/resources/ballerina_sources/invalid_service_26/service.bal
Show resolved
Hide resolved
native/src/main/java/io/ballerina/stdlib/graphql/runtime/engine/Engine.java
Show resolved
Hide resolved
if (type.getTag() == TypeTags.ARRAY_TAG) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to specifically check for the array types here? Is this check needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we get an array type input like float[][]
, type.Package
value is not present. Due to that following if condition will cause to a NPE. if (type.getPackage().getOrg() == null || type.getPackage().getName() == null) {
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then let's add a check like this:
if (type.getPackage() == null) {
return false;
}
if (type.getPackage().getOrg() == null || type.getPackage().getName() == null) {
return false;
}
…-ballerina-graphql into parser-validation-for-inputs
cc24be1
to
e753748
Compare
if (type.getTag() == TypeTags.ARRAY_TAG) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then let's add a check like this:
if (type.getPackage() == null) {
return false;
}
if (type.getPackage().getOrg() == null || type.getPackage().getName() == null) {
return false;
}
Purpose
Fixes: #1837
Fixes: #2133
Examples
Checklist