Gathering detailed insights and metrics for @graphql-inspector/cli
Gathering detailed insights and metrics for @graphql-inspector/cli
Gathering detailed insights and metrics for @graphql-inspector/cli
Gathering detailed insights and metrics for @graphql-inspector/cli
@graphql-inspector/ci
Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.
@test-graphql-cli/validate
Validates documents against a schema and looks for deprecated usage using GraphQL Inspector.
@test-graphql-cli/diff
Compares schemas and finds breaking or dangerous changes using GraphQL Inspector.
@test-graphql-cli/similar
Get a list of similar types in order to find duplicates using GraphQL Inspector.
🕵️♀️ Validate schema, get schema change notifications, validate operations, find breaking changes, look for similar types, schema coverage
npm install @graphql-inspector/cli
Typescript
Module System
Min. Node Version
Node Version
NPM Version
December 09, 2024
Updated on Dec 09, 2024
November 13, 2024
Updated on Nov 13, 2024
June 03, 2024
Updated on Jun 03, 2024
May 26, 2024
Updated on May 26, 2024
May 26, 2024
Updated on May 26, 2024
November 29, 2023
Updated on Nov 29, 2023
TypeScript (86.23%)
MDX (12.12%)
JavaScript (1.45%)
Dockerfile (0.13%)
CSS (0.08%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,712 Stars
2,371 Commits
203 Forks
11 Watchers
98 Branches
78 Contributors
Updated on Jul 03, 2025
Latest Version
5.0.8
Package Id
@graphql-inspector/cli@5.0.8
Unpacked Size
814.60 kB
Size
117.32 kB
File Count
380
NPM Version
10.8.2
Node Version
18.20.5
Published on
Dec 09, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
20
1
GraphQL Inspector outputs a list of changes between two GraphQL schemas. Every change is precisely explained and marked as breaking, non-breaking or dangerous. It helps you validate documents and fragments against a schema and even find similar or duplicated types.
Major features:
GraphQL Inspector has a CLI and also a programmatic API, so you can use it however you want to and even build tools on top of it.
1# CLI 2pnpm add @graphql-inspector/cli 3 4# Core API for programmatic usage 5pnpm add @graphql-inspector/core
Compares schemas and finds breaking or dangerous changes.
CLI:
$ graphql-inspector diff OLD_SCHEMA NEW_SCHEMA
API:
1import { Change, diff } from '@graphql-inspector/core' 2 3const changes: Change[] = diff(schemaA, schemaB)
Finds similar / duplicated types.
CLI:
$ graphql-inspector similar SCHEMA
API:
1import { similar, SimilarMap } from '@graphql-inspector/core' 2 3const similar: SimilarMap = similar(schema, typename, threshold)
Schema coverage based on documents. Find out how many times types and fields are used in your application.
CLI:
$ graphql-inspector coverage DOCUMENTS SCHEMA
API:
1import { coverage, SchemaCoverage } from '@graphql-inspector/core' 2 3const schemaCoverage: SchemaCoverage = coverage(schema, documents)
Validates documents against a schema and looks for deprecated usage.
CLI:
$ graphql-inspector validate DOCUMENTS SCHEMA
API:
1import { InvalidDocument, validate } from '@graphql-inspector/core' 2 3const invalid: InvalidDocument[] = validate(documentsGlob, schema)
Audit your documents for useful metrics such as query depth, directive count and alias count.
CLI:
$ graphql-inspector audit DOCUMENTS
API:
Not available
$ pnpm graphql-inspector audit "packages/**/*.graphql|packages/**/*.ts(x)"
Maximum depth is 16
Maximum alias amount is 3
Maximum directive amount is 6
$ pnpm graphql-inspector audit "packages/**/*.graphql|packages/**/*.ts(x)" --detail
┌────────────────┬───────┬─────────┬────────────┐
│ Operation Name │ Depth │ Aliases │ Directives │
├────────────────┼───────┼─────────┼────────────┤
│ getFoo │ 1 │ 2 │ 6 │
├────────────────┼───────┼─────────┼────────────┤
│ getBar │ 16 │ 3 │ 0 │
└────────────────┴───────┴─────────┴────────────┘
Maximum depth is 16
Maximum alias amount is 3
Maximum directive amount is 6
Serves a GraphQL server with faked data and GraphQL Playground
CLI:
$ graphql-inspector serve SCHEMA
1✅ Serving the GraphQL API on http://localhost:4000/
Introspects a GraphQL Server and writes the result to a file
CLI:
$ graphql-inspector introspect SCHEMA --write schema.json
1✅ Introspection result saved to schema.json
Have a per-repository, self-hosted GraphQL Inspector service or deploy it with Docker.
1# install 2pnpm add --global @graphql-inspector/actions 3# use 4 5$ graphql-inspector-github
1{ 2 "name": "app", 3 "scripts": { 4 "precommit": "graphql-inspector introspect schema.js --write schema.graphql && git add schema.graphql" 5 }, 6 "graphql-inspector": { 7 "diff": true, 8 "schema": { 9 "ref": "master", 10 "path": "schema.graphql" 11 } 12 } 13}
Get GitHub annotations in your PRs.
SCHEMA
Path to a CommonJS or ES Module that exports an object
Example:
graphql-inspector coverage ./src/schema.js
Example with TypeScript:
graphql-inspector coverage ./src/schema.ts --require ts-node/register
1// String 2export default ` 3 type Query { 4 hello: String 5 } 6` 7 8// GraphQLSchema 9export default makeExecutableSchema({...}); 10 11// GraphQL Document 12export default gql` 13 type Query { 14 hello: String 15 } 16` 17 18// IntrospectionQuery result 19export default { 20 data: { 21 __schema: { 22 ... 23 } 24 } 25}
Pointer to a Git repository
Example:
graphql-inspector diff git:origin/master:schema.graphql
Pattern:
git:ref:path/to/file
Pointer to a GitHub repository
Example:
graphql-inspector coverage github:kamilkisiela/graphql-inspector-example#master:schema.graphql
Pattern:
github:owner/name#ref:path/to/file
GraphQL File
Example:
graphql-inspector coverage schema.graphql
graphql-inspector coverage schema.gql
JSON File
Example:
graphql-inspector coverage introspected-schema.json
URL to a GraphQL endpoint
Example:
graphql-inspector coverage https://localhost:3000/graphql
DOCUMENTS
Glob pattern
Example:
graphql-inspector validate ./src/**/*.{js,jsx,tsx,graphql} https://localhost:3000/graphql
Supports TypeScript, JavaScript and GraphQL Files (Extensions: ts,tsx,js,jsx,graphql,gql,graphqls).
Find out what the CLI is capable of:
graphql-inspector --help
graphql-inspector similar --help
MIT © Kamil Kisiela
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/20 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More