Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
avoid crashing with an unhelpful error if the query is incorrect (use…
… case: graphql)
  • Loading branch information
Tenrys committed Apr 19, 2023
commit ecc3a6cbd3eda9ed0b8772e612d943cdd460ce49
3 changes: 2 additions & 1 deletion src/lib/utils/extractNestedActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,14 @@ export function extractRelationWriteActions(
(part): part is string => !!part
);
const arg = get(params, argPath, {});
if (!arg) return; // Prisma validation error

Object.keys(arg)
.filter(isWriteAction)
.forEach((action) => {
/*
Add single writes passed as a list as separate operations.

Checking if the operation is an array is enough since only lists of
separate operations are passed as arrays at the top level. For example
a nested create may be passed as an array but a nested createMany will
Expand Down