-
Notifications
You must be signed in to change notification settings - Fork 668
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 mergeExtensions
and toFullSchemaGQLDocument
#5162
Conversation
✅ Deploy Preview for apollo-android-docs canceled.
|
libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/api.kt
Show resolved
Hide resolved
4d1191b
to
7e29e56
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.
👍
add GQLDocument.toFullSchemaGQLDocument and GQLDocument.mergeExtensions
ed1dab5
to
3c361ce
Compare
I reshuffled the introspection bits again into 2 pieces:
It's a bit verbose but that duplication makes it easier to handle the edge cases of different servers having different version of introspection |
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.
👍
* type Query { | ||
* foo: Int @deprecated(reason: 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.
Could we handle this case by passing isDeprecated
+ deprecationReason
?
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.
The whole IR is based on the premise that isDeprecated = true
implies deprecationReason != null
. Kotlin @Deprecated
annotation also requires a message. I'm still unclear what the use case is for @deprecated(reason: null)
. I'll add a comment there
...st/src/jvmTest/kotlin/com/apollographql/apollo3/graphql/ast/test/IntrospectionTest.jvm.kt.kt
Outdated
Show resolved
Hide resolved
libraries/apollo-gradle-plugin/src/test/kotlin/util/TestUtils.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Benoit Lubek <[email protected]>
GQLDocument.mergeExtensions()
to merge extensions without doing schema validation (closes apollo-ast: support merging definitions without validation #4920)GQLDocument.toFullSchemaGQLDocument()
to generate a verbose GQL document that merges the extensions and also contains the current builtin types as supported by Apollo Kotlin (see also Add Appendix C - Type System Definitions graphql/graphql-spec#1037)This pull request unfortunately contains a bunch of both binary and source breaking changes. Since
apollo-ast
was not advertised as much asapollo-api
andapollo-runtime
, I'm hoping this is OK. I took this opportunity to tweak a bit the public API:okio
is not part of stable the public API anymore (it still is experimentally available though)String
/File
toSchema
directly anymore, you have to go throughGQLDocument
:More comments inline