ZuploZuplo
LoginStart for Free
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop using the Portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingMCP - Quick start
    Develop Locally
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth
Concepts
Development
Policies
    Policy Catalog
    Authentication
    Authorization
    Security & Validation
    Metrics, Billing & Quotas
    Testing
    Request Modification
    Response Modification
    Upstream Authentication
    Archival
    GraphQL
      GraphQL Disable Introspection PolicyGraphQL Introspection Filter PolicyGraphQL Complexity Limit Policy
    Other
    Guides
Handlers
API Keys
MCP Server
MCP Gateway
AI Gateway
Developer Portal
Monetization
Deploying & Source Control
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsSecuritySupportTrust & ComplianceChangelog
powered by Zudoku
GraphQL

GraphQL Disable Introspection Policy

Prevent GraphQL introspection queries on your API to enhance security in production environments. This policy blocks any attempt to discover your schema structure through introspection with a 403 Forbidden response.

With this policy, you'll benefit from:

  • Enhanced API Security: Hide your GraphQL schema structure from potential attackers
  • Selective Protection: Block introspection only for requests passing through Zuplo
  • Production-Ready: Implement security best practices for GraphQL in production
  • Zero Configuration: Works immediately without any additional setup
  • Development Flexibility: Keep introspection enabled in development environments

Configuration

The configuration shows how to configure the policy in the 'policies.json' document.

config/policies.json
{ "name": "my-graphql-disable-introspection-inbound-policy", "policyType": "graphql-disable-introspection-inbound", "handler": { "export": "GraphQLDisableIntrospectionInboundPolicy", "module": "$import(@zuplo/graphql)", "options": {} } }

Policy Configuration

  • name <string> - The name of your policy instance. This is used as a reference in your routes.
  • policyType <string> - The identifier of the policy. This is used by the Zuplo UI. Value should be graphql-disable-introspection-inbound.
  • handler.export <string> - The name of the exported type. Value should be GraphQLDisableIntrospectionInboundPolicy.
  • handler.module <string> - The module containing the policy. Value should be $import(@zuplo/graphql).
  • handler.options <object> - The options for this policy. See Policy Options below.

Policy Options

The options for this policy are specified below. All properties are optional unless specifically marked as required.

Using the Policy

This policy blocks GraphQL introspection queries, which are used to discover the schema structure of your GraphQL API. Introspection is a powerful feature in development but can expose sensitive information about your API in production environments.

How It Works

The policy examines each GraphQL request and checks if it contains introspection queries by looking for the presence of __schema or __type fields in the query. If an introspection query is detected, the policy returns a 403 Forbidden response with the message "Introspection queries are not allowed".

Policy Configuration

This policy requires no configuration options. Simply add it to your route's inbound policies:

Code
{ "name": "disable-introspection", "policyType": "graphql-disable-introspection-inbound", "handler": { "export": "GraphQLDisableIntrospectionInboundPolicy", "module": "$import(@zuplo/graphql)" } }

Usage Examples

Applying to a GraphQL Endpoint

Add the policy to your GraphQL route:

Code
{ "paths": { "/graphql": { "post": { "x-zuplo-route": { "policies": { "inbound": ["disable-introspection", "rate-limit"] }, "handler": { "export": "graphqlHandler", "module": "$import(./handlers/graphql)" } } } } } }

Security Considerations

  • It's recommended to disable introspection in production environments while keeping it enabled in development for tooling support
  • This policy only blocks introspection queries that pass through Zuplo - you can still keep introspection enabled for direct access to your GraphQL server during development
  • Consider combining this policy with authentication policies to further secure your GraphQL API
  • While this policy blocks standard introspection queries, it's still important to implement proper authorization controls for your GraphQL resolvers

Read more about how policies work

Edit this page
Last modified on May 29, 2026
Archive Response to AWS S3 PolicyGraphQL Introspection Filter Policy
On this page
  • Configuration
    • Policy Configuration
    • Policy Options
  • Using the Policy
    • How It Works
    • Policy Configuration
    • Usage Examples
    • Security Considerations
JSON
JSON
JSON