Skip to content

Make list queries return non-nullable data  #2210

Open
@StampixSMO

Description

@StampixSMO

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.
image

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

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions