The Absinthe docs state:
By default, all types in GraphQL are nullable. To declare a type that disallows null, wrap it in a Absinthe.Type.NonNull struct.
I’m working on a large codebase, where I have to put non_null(:string)
on a large number of fields.
I would prefer to have fields be non_null by default and those that can be null, have something like a is_nullable(:integer)
.
This issue has already been discussed with the Absinthe maintainers. The main takeaway was that this could be done with some macros - has anyone attempted this yet? I haven’t written macros before, so just wondering if anyone else has.