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:
extend schema @catchByDefault(to: NULL) to start exploring the directives
Add @catch to individual fields, get more comfortable with how it works
When ready to do the big switch, change to extend schema catch(to: THROW) and (at the same time) add query GetFoo @catch(to: NULL) {} on all operations/fragments (this should be a no-op)
From this moment on, new queries written are catch(to: THROW) by default
See https://github.com/apollographql/specs/pull/50
Bump nullability version to 0.4:
Allows to set
@catchByDefault
on operations/fragments:This unlocks scenarios like:
extend schema @catchByDefault(to: NULL)
to start exploring the directives@catch
to individual fields, get more comfortable with how it worksextend schema catch(to: THROW)
and (at the same time) addquery GetFoo @catch(to: NULL) {}
on all operations/fragments (this should be a no-op)catch(to: THROW)
by defaultquery GetFoo @catch(to: NULL) {}
progressively