@vantreeseba/drizzle-graphql 9.1.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1831,6 +1831,19 @@ image, a stored value the scalar transporting it cannot represent, is
1831
1831
  `DRIZZLE_UNREPRESENTABLE_VALUE`; it says the data is out of range, not that the request was
1832
1832
  wrong.
1833
1833
 
1834
+ An `update`'s `set` giving a `NOT NULL` column an explicit `null` is `DRIZZLE_NOT_NULL`, and the
1835
+ error names the column. Every field of an update input is nullable — that is what makes a partial
1836
+ `set` possible — so the nullability says nothing about the column, and an update has no default to
1837
+ fall back on: `null` there can only mean "write null". Nothing is written, including the rest of
1838
+ the `set`. To leave a column alone, omit it.
1839
+
1840
+ An **insert** reads the same `null` the other way, and is unchanged. A `NOT NULL` column's field
1841
+ on a create input is non-null unless the database, drizzle, or a nested `create` can fill it in,
1842
+ so the only nulls that reach a resolver are ones the schema offered as "I am not supplying this" —
1843
+ and they let the default apply, which is what makes `id: $id` with a null variable insert a new
1844
+ row. A `NOT NULL` column with nothing to fill it is rejected while GraphQL coerces the request.
1845
+ Upserts take the create input, so they follow the insert rule.
1846
+
1834
1847
  The `drizzle` block is only on errors raised from inside a field. An argument rejected while
1835
1848
  GraphQL coerces the request — a `BigInt` variable that is not an integer, say — is rejected
1836
1849
  before any resolver runs, so it carries its `code` but no `drizzle` and no `path`.