dotansimha / graphql-yoga

🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.
https://the-guild.dev/graphql/yoga-server
MIT License
8.25k stars 574 forks source link

feat: batching index in phases #3463

Closed n1ru4l closed 1 week ago

n1ru4l commented 1 week ago

Sometimes it is necessary to know the batching index within the yoga plugin phases.

changeset-bot[bot] commented 1 week ago

🦋 Changeset detected

Latest commit: 1a3fdc1c0cd92f974e4ed1175243aa54c7572f77

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages | Name | Type | | ------------------------------------------ | ----- | | graphql-yoga | Minor | | @graphql-yoga/nestjs | Major | | @graphql-yoga/render-graphiql | Major | | @graphql-yoga/plugin-apollo-inline-trace | Major | | @graphql-yoga/apollo-managed-federation | Major | | @graphql-yoga/plugin-apollo-usage-report | Major | | @graphql-yoga/plugin-apq | Major | | @graphql-yoga/plugin-csrf-prevention | Major | | @graphql-yoga/plugin-defer-stream | Major | | @graphql-yoga/plugin-disable-introspection | Major | | @graphql-yoga/plugin-graphql-sse | Major | | @graphql-yoga/plugin-jwt | Major | | @graphql-yoga/plugin-persisted-operations | Major | | @graphql-yoga/plugin-prometheus | Major | | @graphql-yoga/plugin-response-cache | Major | | @graphql-yoga/plugin-sofa | Major | | apollo-federation-gateway-with-yoga | Patch | | apollo-subgraph-with-yoga | Patch | | graphql-lambda | Patch | | cloudflare-advanced | Patch | | cloudflare | Patch | | nextjs-app | Patch | | hello-world-benchmark | Patch | | @graphql-yoga/nestjs-federation | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 1 week ago
### 💻 Website Preview The latest changes are available as preview in: [https://7b38c697.graphql-yoga.pages.dev](https://7b38c697.graphql-yoga.pages.dev)
github-actions[bot] commented 1 week ago

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

github-actions[bot] commented 1 week ago

✅ Benchmark Results

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}
     ✓ no_errors{mode:uws}
     ✓ expected_result{mode:uws}

     checks.......................................: 100.00% ✓ 528994      ✗ 0     
     data_received................................: 2.1 GB  14 MB/s
     data_sent....................................: 106 MB  709 kB/s
     http_req_blocked.............................: avg=1.43µs   min=992ns    med=1.29µs   max=252.81µs p(90)=1.86µs   p(95)=2.05µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=128.92µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=357.12µs min=219.24µs med=322.69µs max=14.9ms   p(90)=455.95µs p(95)=477.7µs 
       { expected_response:true }.................: avg=357.12µs min=219.24µs med=322.69µs max=14.9ms   p(90)=455.95µs p(95)=477.7µs 
     ✓ { mode:graphql-jit }.......................: avg=287.75µs min=219.24µs med=265.84µs max=14.9ms   p(90)=297.63µs p(95)=313.42µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=483.82µs min=402.32µs med=457.56µs max=10.93ms  p(90)=499.64µs p(95)=528.33µs
     ✓ { mode:graphql-response-cache }............: avg=341.23µs min=267.56µs med=322.01µs max=7.01ms   p(90)=353.19µs p(95)=365.3µs 
     ✓ { mode:graphql }...........................: avg=365.94µs min=271.64µs med=331.33µs max=13.24ms  p(90)=390.03µs p(95)=436.6µs 
     ✓ { mode:uws }...............................: avg=341.59µs min=267.89µs med=321.78µs max=8.94ms   p(90)=353.99µs p(95)=369.97µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 264497
     http_req_receiving...........................: avg=32.62µs  min=16.28µs  med=32.68µs  max=4.47ms   p(90)=37.95µs  p(95)=40.04µs 
     http_req_sending.............................: avg=8.06µs   min=5.95µs   med=7.15µs   max=808.75µs p(90)=10.6µs   p(95)=11.24µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=316.43µs min=181.05µs med=282.83µs max=14.82ms  p(90)=414.79µs p(95)=434.2µs 
     http_reqs....................................: 264497  1763.292681/s
     iteration_duration...........................: avg=562.32µs min=383.8µs  med=525.16µs max=15.39ms  p(90)=665.02µs p(95)=691.36µs
     iterations...................................: 264497  1763.292681/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2