Skip to content

Required schema fields are not required in GraphQL types #224

@koredefashokun

Description

@koredefashokun

I noticed that the GraphQL types don't make use of the required option on Mongoose filters. Is there a reason for this? It would also be nice to have an option to make the types returned from the resolvers required as well, i.e.

storeOne: Store!
storeMany: [Store!]!

instead of the default, which looks something like this:

storeOne: Store
storeMany: [Store]

The main reason I have an issue with this is that handling conditionals for values that will always be returned on the frontend is a huge pain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions