Open aprilrd opened 3 years ago
š thanks for this! this is super helpful in working out the corner cases :)
I'm having a little trouble understand the tables in context - maybe we could add example schema + queries / fragments and label the axes?
(I took a stab at it but then deleted my comments cos i realized i was being dumb :P)
Definitely, I will add more labels to the tables. I also liked your suggestion to add some examples to ground the cases in the tables so I will do that as well.
Updated the issue with examples and added the current status of tests we have. I marked open questions with the checkboxes.
Here is a prroposed list of validations with nullability operators. I am sure there are cases that I missed here so please comment below if you see any cases missed. The current changeset on graphql-js was made with this list in mind, but we need to audit and make sure they behave per this list.
Schema + Operation validation
All the tests under this section assumes this following schema
When types are not mutually exclusive (same parent / interface)
When a field is nullable
With aliases
Current Status
Current test case
Without aliases
Current Status
Sample test cases
When a field is non-nullable
With aliases
Current Status
Current Test Case
Both with or without aliases
Current Status
Sample test cases
When types are exclusive
Here, with aliases, all combinations are valid.
Fields are both nullable
Current Status
Sample test cases
Fields are both non-nullable
Current Status
Sample test cases The current schema does not have non-nullable fields across exclusive types. We need to add that first.
Field A is nullable and Field B is non-nullable
Current Status
Sample test cases
Operation only validation
Given fragment A and fragment B (one of them could just be a selection set)
Current Status
invalid
. I believe it should be valid. Open for feedbackSample test cases