GraphQL Endpoint
API Endpoint:Authentication
GraphQL requests require authentication via bearer token:GraphQL Request Format
Query
Mutation
Subscription (WebSocket)
Subscriptions require a WebSocket connection:API Structure
The Meshery GraphQL API consists of three main operation types:Queries
Read-only operations to fetch data:- Control Plane - Query service mesh control plane status
- Data Plane - Query service mesh data plane proxies
- Namespaces - List Kubernetes namespaces
- Performance - Fetch performance test results
- Patterns - Query design patterns
- Filters - Query WASM filters
- MeshModel - Query infrastructure models
- And more…
Mutations
Write operations to modify state:- changeOperatorStatus - Deploy or undeploy Meshery Operator
- changeAdapterStatus - Enable or disable service mesh adapters
Subscriptions
Real-time updates via WebSocket:- subscribeEvents - Stream platform events
- subscribeMesheryControllersStatus - Monitor controller status
- subscribeClusterResources - Watch cluster resource changes
- subscribePerfResults - Real-time performance test updates
- subscribeConfiguration - Monitor pattern and filter changes
- subscribeMeshModelSummary - Track MeshModel statistics
Schema Introspection
Query the GraphQL schema:Error Handling
GraphQL errors are returned in the response:Common Types
Scalars
- String - UTF-8 character sequences
- Int - Signed 32-bit integers
- Float - Signed double-precision floating-point values
- Boolean -
trueorfalse - ID - Unique identifier (serialized as String)
- Time - ISO 8601 timestamp
- Map - JSON object/map
- Any - Any valid JSON value
Enums
- MeshType - Service mesh types (ISTIO, LINKERD, CONSUL, etc.)
- Status - Entity status (ENABLED, DISABLED, CONNECTED, etc.)
- Severity - Event severity (alert, critical, error, warning, etc.)
- MesheryController - Controller types (BROKER, OPERATOR, MESHSYNC)
- MesheryControllerStatus - Controller status values
Pagination
Many queries support pagination via thePageFilter input:
Directives
@KubernetesMiddleware
Applied to fields that require Kubernetes context:Best Practices
Request Only What You Need
GraphQL allows you to specify exactly which fields you want: Good:Use Fragments for Reusability
Handle Errors Gracefully
Always check for bothdata and errors in responses:
Testing with GraphQL Playground
- Navigate to
http://localhost:9081/api/system/graphql/playground - Set authorization header:
- Explore the schema using the “Docs” tab
- Run queries, mutations, and subscriptions interactively
Next Steps
Queries
Explore available queries
Mutations
Modify resources with mutations
Subscriptions
Subscribe to real-time updates