coprocessor
The coprocessor configuration enables external request hooks in Hive Router.
For docs and usage guidance, see Coprocessors.
Top-level options
url
- Type:
string - Required: Yes
Endpoint of the external coprocessor service.
Supported formats:
http://host[:port][/path]https://host[:port][/path]unix:///absolute/path/to/socket.sockunix:///absolute/path/to/socket.sock?path=/request/path
For HTTPS endpoints, the certificate is verified against the system root certificates by default.
Use the tls option to configure custom certificate authorities or client certificates.
protocol
- Type:
string - Required: Yes
- Allowed values:
http1,h2c,http2
Transport protocol used to call the coprocessor endpoint.
http1= HTTP/1.1 over TCPh2c= HTTP/2 cleartext over TCPhttp2= HTTP/2 over TLS; requires anhttps://URL
tls
- Type:
object - Default: System root certificates for HTTPS; no client certificate
TLS settings for an https:// coprocessor endpoint. This setting is independent of
traffic_shaping.all.tls; it does not inherit the subgraph TLS configuration. When omitted, the
coprocessor certificate is verified using the system root certificates.
Set cert_file to trust custom CA certificates. For mutual TLS, set client_auth.cert_file and
client_auth.key_file to the client certificate and private key. For the available file formats,
see subgraph TLS configuration.
timeout
- Type:
string - Default:
1s
Timeout for a single coprocessor call.
Examples: 100ms, 1s, 2s.
stages
- Type:
object - Default:
{}
Stage-specific configuration.
Top-level keys:
routergraphql
Stage structure
All stages are optional. A stage runs only if its object is configured.
Stage options
Each stage supports two keys:
conditioninclude
condition
- Type:
boolean | expression - Default:
true
If set, the stage runs only when the condition evaluates to true.
Example:
include
- Type: stage-specific object
- Default: all include fields disabled
Selects which fields Hive Router sends to your coprocessor for that stage.
Important: include controls what is sent to the coprocessor. It does not define all mutation
permissions on returned data.
router stage options
router.request
For WebSocket connections, this hook runs once on the HTTP upgrade request. The request context is
shared by all operations on that connection, so context entries set by this hook on the upgrade
request are visible to the per-operation stages (graphql.request, graphql.analysis and
graphql.response) of every operation on the connection.
router.response
graphql stage options
graphql.request
graphql.analysis
graphql.response
Selection formats
context selection
context supports three forms:
false- include no contexttrue- include full context- list of keys - include selected keys only
GraphQL body selection
For graphql.request.include.body and graphql.analysis.include.body:
false- include no body fieldstrue- include all body fields- list - include selected body fields
Allowed list values:
queryoperationNamevariablesextensions