apollographql / apollo-kotlin

:rocket:  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
https://www.apollographql.com/docs/kotlin
MIT License
3.74k stars 653 forks source link

Nullability: remove `@ignoreErrors`, `@catchField` and add `@catchByDefault` #6002

Closed martinbonnin closed 3 months ago

martinbonnin commented 3 months ago

See https://github.com/apollographql/specs/pull/50

Bump nullability version to 0.4:

extend schema @link(url: "https://specs.apollo.dev/nullability/v0.4", import: ["@semanticNonNull", "@catch", "@catchByDefault", "CatchTo"])

extend schema @catchByDefault(to: THROW) # or some other default

Allows to set @catchByDefault on operations/fragments:

fragment QueryDetails on Query @catchByDefault(to: RESULT) {
  nonNull 
  nullable 
}

query Fragments @catchByDefault(to: NULL) {
  ...QueryDetails
  nonNull 
  nullable 
}

This unlocks scenarios like:

netlify[bot] commented 3 months ago

Deploy Preview for apollo-android-docs canceled.

Name Link
Latest commit b83408dcbaeb8b0127fe42319cd7b4e6f1dd97e0
Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/667c939ff1cc140007bd8ff1