2 ms·
Model access control into the schema. Create a BaseUser type and an UnauthorizedAccess type, then a union of the two, refer to the union in nearly all scenarios
by andrewingram 9y ago
Model access control into the schema. Create a BaseUser type and an UnauthorizedAccess type, then a union of the two, refer to the union in nearly all scenarios where you want to create a relationship to a User.
GraphQL gives you access to a relatively powerful (but sadly incomplete) type system, you have a much better time if you take full advantage of it.
- schickling 9y agoWhich features are you missing in GraphQL's type system?
- andrewingram 9y agoUnions on scalars, unions on input types, intersection types, and generics. Arrays are already a generic type, but we're unable to create new ones.