Hi, we have set up usage data/insights sending from Hive Router to the Hive Console, but we have encountered issues with the operation body being incorrect.
It seems that when we send a GraphQL document containing more than one operation and select a specific one (non-first) using operationName, it always shows the first query body regardless of what operationName contains.
I tried the same setup with the Hive Gateway, but it seems to be producing the same (invalid) results.
Minimal reproduction:
- Create a new project in Console and generate required tokens (1x for registry, 1x for hive telemetry)
- Download the official SWAPI schema from https://github.com/graphql/swapi-graphql/blob/master/schema.graphql
- Configure
supergraph.yaml with
federation_version: =2.3.2
subgraphs:
swapi:
routing_url: https://graphql.org/graphql/
schema:
file: ./schema.graphql
rover supergraph compose --config ./supergraph.yaml > supergraph.graphql
hive schema:publish --target "..." --registry.accessToken "..." --author "Test" --commit "test" ./supergraph.graphql
- Configure Router's
router.config.yaml with
supergraph:
source: file
path: ./supergraph.graphql
telemetry:
hive:
token: ...
target: ...
usage_reporting:
enabled: true
tracing:
enabled: true
- Run the Router
docker run -p 4000:4000 -v ./supergraph.graphql:/app/supergraph.graphql -v ./router.config.yaml:/app/router.config.yaml ghcr.io/graphql-hive/router:latest
- Send a query containing at least two operations and select the non-first one in
operationName
curl 'http://localhost:4000/graphql' \
-H 'accept: application/graphql-response+json, application/json, multipart/mixed' \
-H 'content-type: application/json' \
--data-raw '{"query":"query first{__typename} query second{allFilms{totalCount}}","operationName":"second"}'
- Observe "Insights" in the Console application showing the first operation body in the
second operations/traces.
Note that this is not reproducible using the Web IDE bundled with Router as it always only sends the part of the body relevant to the selected operation instead of the whole document.
Hi, we have set up usage data/insights sending from Hive Router to the Hive Console, but we have encountered issues with the operation body being incorrect.
It seems that when we send a GraphQL document containing more than one operation and select a specific one (non-first) using
operationName, it always shows the first query body regardless of whatoperationNamecontains.I tried the same setup with the Hive Gateway, but it seems to be producing the same (invalid) results.
Minimal reproduction:
supergraph.yamlwithrover supergraph compose --config ./supergraph.yaml > supergraph.graphqlhive schema:publish --target "..." --registry.accessToken "..." --author "Test" --commit "test" ./supergraph.graphqlrouter.config.yamlwithdocker run -p 4000:4000 -v ./supergraph.graphql:/app/supergraph.graphql -v ./router.config.yaml:/app/router.config.yaml ghcr.io/graphql-hive/router:latestoperationNamesecondoperations/traces.Note that this is not reproducible using the Web IDE bundled with Router as it always only sends the part of the body relevant to the selected operation instead of the whole document.