-
Notifications
You must be signed in to change notification settings - Fork 653
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 validation to check schema definitions are compatible with the bundled ones #5444
Conversation
✅ Deploy Preview for apollo-android-docs canceled.
|
libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/gqldirective.kt
Outdated
Show resolved
Hide resolved
…n nullability are semantically equal
b671798
to
c503433
Compare
libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/Issue.kt
Outdated
Show resolved
Hide resolved
...es/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/semanticEquals.kt
Outdated
Show resolved
Hide resolved
...es/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/semanticEquals.kt
Outdated
Show resolved
Hide resolved
...es/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/semanticEquals.kt
Show resolved
Hide resolved
...es/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/semanticEquals.kt
Outdated
Show resolved
Hide resolved
...es/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/semanticEquals.kt
Outdated
Show resolved
Hide resolved
...es/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/semanticEquals.kt
Outdated
Show resolved
Hide resolved
...lo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/SchemaValidationScope.kt
Outdated
Show resolved
Hide resolved
…pollo3/ast/internal/SchemaValidationScope.kt Co-authored-by: Martin Bonnin <martin@mbonnin.net>
...es/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/semanticEquals.kt
Show resolved
Hide resolved
private fun GQLDirective.isDefinedAndMatchesOriginalName(schema: Schema, originalName: String): Boolean { | ||
return schema.directiveDefinitions.get(name) != null && schema.originalDirectiveName(name) == originalName |
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.
Apologies for nitpicking this but I'd rather have the codegen crash than silently ignore missing directive definitions.
All directive usage of @catch
must be validated at that point so if we don't have a directive definition, it's a programming error that I'd rather catch (no pun intended) early
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.
Not sure why I had the impression it would still NPE without this, but it's not the case - just removed it 👍
Can you update the title/description of this PR ? |
Make sure the definitions are "semantically equal".