A Plugin for PostGraphile that adds Postgres upsert mutations (INSERT … ON CONFLICT DO UPDATE) to your GraphQL API. Current stable version is 3.3.0, released under semantic-release cadence. Supports single and multi-column unique indexes via an optional `where` clause, and allows omitting columns from the update set using `@omit updateOnConflict` smart tags. Differentiates from the original generator-based plugin by being fully TypeScript-typed and following modern PostGraphile plugin conventions. Requires PostGraphile v4 or later.
npm install postgraphile-upsert-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to install the plugin in a PostGraphile server using Express and the appendPlugins configuration.
Ensure your Postgres table has a primary key or a unique index on the columns used in the 'where' argument.
Include all columns from the unique constraint in the input object.
Use import PgMutationUpsertPlugin from 'postgraphile-upsert-plugin' instead of import { PgMutationUpsertPlugin } from 'postgraphile-upsert-plugin'.Place the smart tag on the specific column comment, not on the constraint comment.
Add a primary key or unique constraint to the table.
Run 'npm install postgraphile-upsert-plugin' and ensure the import path matches the package name.
Use import PgMutationUpsertPlugin from 'postgraphile-upsert-plugin' instead of const PgMutationUpsertPlugin = require('postgraphile-upsert-plugin').default.