Hub rules-graphql

rules-graphql

v3 public Verified

GraphQL

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. These rules govern schema design, query optimization, and secure API interaction for AI agents.

@sigmashakeinc 2 pulls 9 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-graphql →
Severity
2 error 7 warn 0 info
demo.cast
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. These rules govern schema design, query optimization, and secure API interaction for AI agents.

Rules index

9 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

graphql

graphql-block-unsafe-patterns warning ask

Potentially unsafe pattern detected in graphql code: "resolve(". Review the use case — this may indicate a security risk, a deprecated API, or a misconfiguration. Confirm the write is intentional.

Rule source requires an active Pro or Enterprise subscription.
graphql-force-updated-api warning log

You are using an outdated API for graphql. Please upgrade to the newer API.

Rule source requires an active Pro or Enterprise subscription.
no-graphql-batching-unlimited warning log

RISK: Unlimited query batching allows an attacker to send thousands of operations in a single HTTP request, multiplying server load and enabling credential-stuffing-style enumeration against resolvers. FIX: Set allowBatchedHttpRequests: false or add a batchLimit; implement rate limiting at the connection level.

Rule source requires an active Pro or Enterprise subscription.
no-graphql-field-suggestions-enabled warning log

RISK: Apollo Server's default 'Did you mean X?' field suggestions leak partial schema information even when introspection is disabled — attackers use suggestion leakage to enumerate field names one character at a time. FIX: Set hideSchemaDetailsFromClientErrors: true in ApolloServer options or disable field suggestions via @escape-technologies/graphql-armor.

Rule source requires an active Pro or Enterprise subscription.
no-graphql-introspection-in-prod warning log

RISK: Enabling GraphQL introspection in production exposes the full schema to attackers — field names, types, and relationships — accelerating reconnaissance before targeted injection or IDOR attacks. FIX: Disable introspection in production (NODE_ENV === 'production' guard or dedicated config flag); use tools like GraphQL Armor or Apollo Studio for schema exploration in dev.

Rule source requires an active Pro or Enterprise subscription.
no-graphql-missing-depth-limit warning log

RISK: GraphQL without query depth limits is vulnerable to deeply nested query DoS attacks — a single query like { user { friends { friends { friends ... } } } } can exhaust CPU/memory with O(n^k) resolver calls. FIX: Add graphql-depth-limit or @escape-technologies/graphql-armor's maxDepth plugin; enforce a depth of 7-10 for typical APIs.

Rule source requires an active Pro or Enterprise subscription.
no-graphql-playground-in-prod warning log

RISK: Enabling GraphQL Playground or GraphiQL in production exposes an interactive query editor to any visitor, allowing exploration of the full schema and direct execution of any authorized query. FIX: Guard playground/graphiql with a NODE_ENV !== 'production' check; disable entirely in prod.

Rule source requires an active Pro or Enterprise subscription.
no-graphql-sql-injection-in-resolver error block

RISK: String-concatenating GraphQL resolver arguments into SQL queries is SQL injection — attackers pass ' OR '1'='1 as any argument to dump the database (CWE-89). FIX: Use parameterised queries (prepared statements, ORM query builders) and never concatenate user-supplied resolver args into SQL strings.

Rule source requires an active Pro or Enterprise subscription.
no-graphql-unauthenticated-mutation error block

RISK: GraphQL mutations without authentication checks allow unauthenticated callers to modify data — a common misconfiguration that exposes create/update/delete operations to the public internet (CWE-306). FIX: Add auth middleware (isAuthenticated directive, shield, or context.user guard) to every mutation resolver; default-deny with explicit opt-out for public operations.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
3257d33707afb1f86a15a7a2f8a4bc1ba9e5e670c48dfd90634871d1ac7357e3
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-graphql/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-graphql. The published version only bumps when a maintainer resyncs.

No commit history available.