Skip to content

Conversation

@ardatan
Copy link
Member

@ardatan ardatan commented Nov 10, 2025

Ref ROUTER-104

Documentation -> graphql-hive/console#7260

  • Supports Hive's documentId spec, Relay's doc_id spec and Apollo's extensions based spec as options
    • It is also possible to use your own method to extract document ids using VRL expressions
  • Hive Console and File sources are supported
  • A flag to enable/disable arbitrary operations
    • A VRL Expression can also be used to decide this dynamically using headers or any other request details

Learn more about this implementation;
https://github.com/graphql-hive/console/blob/persisted_documents/packages/web/docs/src/content/router/configuration/persisted_documents.mdx

In addition to support URL path params;

Related Changes

graphql_endpoint Configuration and .request.path_params in VRL

This PR also adds support for configuring the GraphQL endpoint path via the graphql_endpoint configuration option.

So you can have dynamic path params that can be used with VRL expressions.

path_params are also added to .request context in VRL for more dynamic configurations.

http:
  graphql_endpoint: /graphql/{document_id}
persisted_documents:
  enabled: true
  spec:
    expression: .request.path_params.document_id

New graphql_endpoint docs -> https://github.com/graphql-hive/console/blob/persisted_documents/packages/web/docs/src/content/router/configuration/http.mdx#graphql_endpoint
New .request.path_params docs -> https://github.com/graphql-hive/console/blob/persisted_documents/packages/web/docs/src/content/router/configuration/expressions.mdx#request

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

k6-benchmark results

     ✓ response code was 200
     ✓ no graphql errors
     ✓ valid response structure

     █ setup

     checks.........................: 100.00% ✓ 203358      ✗ 0    
     data_received..................: 5.9 GB  198 MB/s
     data_sent......................: 80 MB   2.6 MB/s
     http_req_blocked...............: avg=3.48µs   min=721ns  med=1.92µs  max=5.33ms   p(90)=2.87µs   p(95)=3.35µs 
     http_req_connecting............: avg=557ns    min=0s     med=0s      max=1.85ms   p(90)=0s       p(95)=0s     
     http_req_duration..............: avg=21.69ms  min=2.4ms  med=20.67ms max=222.93ms p(90)=29.46ms  p(95)=32.9ms 
       { expected_response:true }...: avg=21.69ms  min=2.4ms  med=20.67ms max=222.93ms p(90)=29.46ms  p(95)=32.9ms 
     http_req_failed................: 0.00%   ✓ 0           ✗ 67806
     http_req_receiving.............: avg=194.92µs min=25.3µs med=43.43µs max=190.8ms  p(90)=103.69µs p(95)=448.6µs
     http_req_sending...............: avg=29.76µs  min=5.88µs med=11.31µs max=26.43ms  p(90)=18.03µs  p(95)=29.95µs
     http_req_tls_handshaking.......: avg=0s       min=0s     med=0s      max=0s       p(90)=0s       p(95)=0s     
     http_req_waiting...............: avg=21.46ms  min=2.35ms med=20.53ms max=102.27ms p(90)=29.17ms  p(95)=32.54ms
     http_reqs......................: 67806   2255.133202/s
     iteration_duration.............: avg=22.12ms  min=6.56ms med=21.03ms max=258.33ms p(90)=29.95ms  p(95)=33.37ms
     iterations.....................: 67786   2254.46803/s
     vus............................: 50      min=50        max=50 
     vus_max........................: 50      min=50        max=50 

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

🐋 This PR was built and pushed to the following Docker images:

Image Names: ghcr.io/graphql-hive/router

Platforms: linux/amd64,linux/arm64

Image Tags: ghcr.io/graphql-hive/router:pr-564 ghcr.io/graphql-hive/router:sha-c51d6d8

Docker metadata
{
"buildx.build.ref": "builder-a6b6e54b-eacf-4fbd-a0c4-275ecad30dd1/builder-a6b6e54b-eacf-4fbd-a0c4-275ecad30dd10/lyf4e6zjp81819bx1q12p2tiw",
"containerimage.descriptor": {
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "digest": "sha256:53552650a34a168576d86f739438c24b37ef5079496a5a426d652566aab81f49",
  "size": 1609
},
"containerimage.digest": "sha256:53552650a34a168576d86f739438c24b37ef5079496a5a426d652566aab81f49",
"image.name": "ghcr.io/graphql-hive/router:pr-564,ghcr.io/graphql-hive/router:sha-c51d6d8"
}

@ardatan ardatan marked this pull request as ready for review November 12, 2025 11:49
@ardatan ardatan requested review from dotansimha and kamilkisiela and removed request for dotansimha November 12, 2025 12:01
@ardatan ardatan requested a review from dotansimha November 12, 2025 12:57
@ardatan ardatan changed the title Persisted Documents feat(router): persisted documents Nov 12, 2025
Base automatically changed from primitive-expression to main November 21, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant