diff --git a/packages/postgrest-react-query/src/mutate/use-upsert-mutation.ts b/packages/postgrest-react-query/src/mutate/use-upsert-mutation.ts index 23ad4f651..78e38bf0c 100644 --- a/packages/postgrest-react-query/src/mutate/use-upsert-mutation.ts +++ b/packages/postgrest-react-query/src/mutate/use-upsert-mutation.ts @@ -53,6 +53,7 @@ function useUpsertMutation< query: query ?? undefined, queriesForTable, disabled: opts?.disableAutoQuery, + onConflict: primaryKeys.join(','), ...opts, })(input); if (data) { diff --git a/packages/postgrest-swr/src/mutate/use-upsert-mutation.ts b/packages/postgrest-swr/src/mutate/use-upsert-mutation.ts index 707ce1bdd..6ba75e823 100644 --- a/packages/postgrest-swr/src/mutate/use-upsert-mutation.ts +++ b/packages/postgrest-swr/src/mutate/use-upsert-mutation.ts @@ -56,6 +56,7 @@ function useUpsertMutation< query: query ?? undefined, queriesForTable, disabled: opts?.disableAutoQuery, + onConflict: primaryKeys.join(','), ...opts, }, )(arg);