Skip to content
Discussion options

You must be logged in to vote

Hey there.

This is because, even though fields are required, you might restrict access to them and they will return null.
What you are looking for is described here (note though that not all fields support this).

So you schema should look like:

export const Post = list({
  access: allowAll,
  fields: {
    title: text({ validation: { isRequired: true }, graphql: { read: { isNonNull: true } } }),
    name: text({ validation: { isRequired: true }, graphql: { read: { isNonNull: true } } }),
    label: text({ validation: { isRequired: true }, graphql: { read: { isNonNull: true } } }),
    created_at: timestamp({ defaultValue: { kind: 'now' }, graphql: { read: { isNonNull: true } } }),
    upd…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@dcousens
Comment options

Answer selected by tofsjonas
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #8306 on February 15, 2023 04:09.