New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default input values for insert mutations #990

Closed
davbeck opened this Issue Feb 6, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@davbeck
Copy link

davbeck commented Feb 6, 2019

I'm submitting a ...

  • bug report
  • feature request
  • question

PostGraphile version: "postgraphile": "^4.3.2"

Is it possible to include default values for the builtin insert mutations? I set a default value on my column, but I get "Field TeamInput.organizationId of required type UUID! was not provided." when I don't include it in the mutation input parameters. It looks like the error is coming from the GraphQL layer, not the database.

@benjie

This comment has been minimized.

Copy link
Member

benjie commented Feb 6, 2019

We have tests for this; are you sure that organizationId actually has a default value in your database? If it does, then PostGraphile should detect it as nullable rather than non-nullable.

@benjie benjie added the question label Feb 6, 2019

@davbeck

This comment has been minimized.

Copy link
Author

davbeck commented Feb 6, 2019

🤦🏻‍♂️ I didn't have watchPg turned on and hadn't restarted the server after adding the default.

@davbeck davbeck closed this Feb 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment