webiny-js
webiny-js copied to clipboard
Make list queries return non-nullable data
Is your feature request related to a problem? Please describe.
When integrating the exposed GraphQL API in typed languages (e.g. TypeScript), you have to write boilerplate code to check for nullability of the data field inside ListX queries. Inherently though, I believe the returned values can never be null.

It also cause for the following ugly-looking typings in for example TS:

Describe the solution you'd like.
Ideally, Webiny can return a non-nullable data field for the returned array + non-nullable actual type values inside the array. In the example above, that would be [Product!]! instead of [Product].
Describe alternatives you've considered.
I've thought about wrapping the schema and adjusting the typings, but that requires a gateway in front of Webiny.
This issue is stale because it was opened 120 days with no activity. Remove the "stale-issue" label or leave a comment to revive the issue. Otherwise, it will be closed in 7 days.