-
Notifications
You must be signed in to change notification settings - Fork 662
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 a flag to disable fieldsCanMerge validation on disjoint types #4342
Add a flag to disable fieldsCanMerge validation on disjoint types #4342
Conversation
@pt2121: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
👷 Deploy request for apollo-android-docs pending review.Visit the deploys page to approve it
|
26276ff
to
6c7cf00
Compare
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.
Thank you for this!
A few comments, but looks good overall.
apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/Options.kt
Outdated
Show resolved
Hide resolved
apollo-ast/src/main/kotlin/com/apollographql/apollo3/ast/gqloperationdefinition.kt
Outdated
Show resolved
Hide resolved
apollo-ast/src/main/kotlin/com/apollographql/apollo3/ast/api.kt
Outdated
Show resolved
Hide resolved
apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/ValidationTest.kt
Outdated
Show resolved
Hide resolved
apollo-ast/src/main/kotlin/com/apollographql/apollo3/ast/internal/ExecutableValidationScope.kt
Outdated
Show resolved
Hide resolved
Thanks for the feedback! I will look into them tonight. |
66eaeca
to
e8313e9
Compare
apollo-gradle-plugin-external/src/main/kotlin/com/apollographql/apollo3/gradle/api/Service.kt
Outdated
Show resolved
Hide resolved
e8313e9
to
4d04041
Compare
4d04041
to
641f5f9
Compare
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.
Thanks a lot! This looks good 👍
apollo-ast/src/main/kotlin/com/apollographql/apollo3/ast/api.kt
Outdated
Show resolved
Hide resolved
apollo-ast/src/main/kotlin/com/apollographql/apollo3/ast/internal/ExecutableValidationScope.kt
Outdated
Show resolved
Hide resolved
apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/ValidationTest.kt
Outdated
Show resolved
Hide resolved
...ler/src/test/kotlin/com/apollographql/apollo3/compiler/FieldsOnDisjointTypesMustMergeTest.kt
Show resolved
Hide resolved
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.
A few comments but looks good to me overall. Let me know what you think.
On a separate note, reviewing this, I realized we have a bug in the validation logic and something like below doesn't throw a validation error:
type Query {
value: Int
value2: Int
}
{
value
value: value2
}
A server should (rightfully) forbid this. Since this is permissive at the moment, I don't want to break other people workflows by making this more strict but this is certainly something to revisit for v4
Martin, thanks for the review. I'll look into them this weekend. |
Thanks for the contribution! I just launched the CI tests. I'll merge once everything is ✅ |
Sounds good, thanks for a small ticket for a new contributor 🙂 |
Ah, test failed somehow. 😅 |
That's a flake, I've seen it before (see also #3920). I just relaunched the CI, it should pass this time |
It's all merged. Thanks again for the contribution! |
re #4320
Basically, I skip
fieldsInSetCanMerge
if thefieldOnDisjointTypesMustMerge
flag istrue
.Please let me know if that's the expectation.