gqty
gqty copied to clipboard
RFC: Dropping data skeletons in React
There have been discussions on the necessity of adding MakeNullable<T> in codegen.
It was deemed necessary back then because the original design was to always return undefined placeholder data to favor skeleton/glimmar loaders.
Since React 18 is officially out, we can count on suspense mode now. I think it is time to ask this question again.
If this is a favorable change, suspense mode will be the ONLY mode, hence dropping undefined as data skeleton altogether.
This would be a breaking change, I would like to know the impact to existing users.
Do you think it is a good idea?
Examples
Given the following GraphQL schema
type Query {
foo: String!
bar: String
}
It will produce the following types:
const query = useQuery();
query.foo; // string
query.bar; // string | null