Replies: 1 comment 2 replies
-
Thank you so much for writing this! Question about solution 5. You write:
Can you ellaborate? Assuming we have this: type Query {
user: User
}
type User {
name: String
email: String
} Which is turned into the non-nullable version: type Query {
user: User!
}
type User {
name: String!
email: String!
} The Java Model probably looks something like this: public class User {
String name;
String email;
} My understanding was that Relay (or the Java client you're using) would be able to detect errors and process them to the closest error boundary so that |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This document assesses each open source proposal for semantic nullability in terms of ease of adoption at Meta. We will reference proposal numbers outlined in the open source document.
Obviously ease of adoption is not the only consideration. This is meant to serve as a case study of how adoption of the different proposals would play out at a company of Meta’s size/with a similar GraphQL stack.
Meta’s GraphQL Stack
?
in Swift on a type that is not nullable will result in a compilation error)What makes new SDL syntax easy to adopt
!
) in the SDL is more likely to lead to unintentional changes in behaviorSolutions 1 & 6
(Grouped together as the adoption story is the same for these two solutions)
Adopting this new syntax in the SDL is easy (and in fact we are already using Solution 6 internally).
Because these solutions propose purely new syntax, these changes are no-ops without changes to the logic that consumes the schema.
Solution 2
TL;DR Schema-parsing might break, but the fix (per schema consumer) is easy
Rejected - click for details
@strictNullability
and?
are new to the SDL.?
and continuing to interpret those fields as nullable, there will be no changes to generated models (as no annotation will still be interpreted as nullable until the consumer logic is updated)@strictNullability
) that change how syntax is interpreted.Solution 3
TL;DR Schema parsing might break; app builds might break; could have more unintentional null bubbling, but the fix (per schema consumer) is easy
Rejected - click for details
?
to unwrap nulls cannot be used on non-null types in Swift)!
types (now!!
) being interpreted as having no annotation (and thus being nullable):@strictNullability
document-level directive@strictNullability
document-level directive to new fields (initially)@strictNullability
) that change how syntax is interpreted.Solution 4 (assuming input syntax is unchanged)
TL;DR schema-parsing might break, but the fix (per schema consumer) is easy
Rejected - click for details
?
and continuing to interpret those fields as nullable, there will be no unintended change to generated models@strictNullability
) that change how syntax is interpreted.Solution 5
TL;DR Things might break badly (a lot more null-bubbling), AND the fix is hard
Rejected - click for details
?
to unwrap nulls cannot be used on non-null types in Swift)Solution 7
TL;DR Things might break badly (a lot more null-bubbling), but the fix (per schema consumer) is easy
?
to unwrap nulls cannot be used on non-null types in Swift)Beta Was this translation helpful? Give feedback.
All reactions