Registry / testing / duplicate-operation-name

duplicate-operation-name

JSON →
library1.0.0jsnpmunverified

A CLI tool to detect duplicate GraphQL operation names (queries, mutations, subscriptions) in static GraphQL files (.graphql) and source files (.ts, .tsx, .js, .jsx). Currently at version 1.0.0 with no regular release cadence. It recursively scans directories or single files, reporting duplicate names with counts. Differentiators: focused solely on duplicate detection, supports multiple file types, and can be used in CI/CD pipelines. Alternatives like persistgraphql are broader in scope.

npm install duplicate-operation-name
INSTALL
IMPORT
SIG · DUPLICATE-OPERATIO
D
duplicate-operation-name
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

duplicate-operation-name (CLI)
npx duplicate-operation-name <path> --graphql
duplicate-operation-name <path> (missing flag)
Since it's a CLI tool, no JavaScript import is available. The binary is invoked directly.

Scans a directory recursively for duplicate GraphQL operation names in .graphql, .ts, and .js files.

npx duplicate-operation-name ./queries --graphql --ts --js
Debug
Known issues
gotchaAt least one file type flag (--graphql, --ts, --js) must be provided, otherwise the tool prints usage and exits.
fix
Include one or more flags: --graphql, --ts, --js
affects: >=1.0.0
Errors
Common errors & fixes
Error: Found duplicate operation names: 3 x myOperationName1 2 x myOperationName2
Multiple GraphQL operations share the same name in the scanned files.
fix
Rename duplicate operations to have unique names across all files.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
duplicate-operation-name — npm install duplicate-operation-name · libregistry