graphql-api
graphql-api copied to clipboard
Explicit type for nullable objects
It's possibly a bit dodgy relying on Maybe Foo in a schema definition to mean "Foo is nullable". I've forgotten why it's dodgy, but @teh can fill in.
Experience from Aeson shows that we want to be very clear about the difference between a missing field and null. Maybe can communicate both, but in JSON missing and null are not the same (e.g. in JavaScript they get decoded to undefined and null on key lookup).
So IMO we should mark fields that can be null and fields that are optional differently and clearly.