Postgraphile: Default input values for insert mutations

Created on 6 Feb 2019  ·  2Comments  ·  Source: graphile/postgraphile

I'm submitting a ...

  • [ ] bug report
  • [ ] feature request
  • [x] 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.

❔ question

All 2 comments

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.

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

Was this page helpful?
0 / 5 - 0 ratings