Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pass context to onParams hook #3464

Merged
merged 6 commits into from
Nov 8, 2024
Merged

feat: pass context to onParams hook #3464

merged 6 commits into from
Nov 8, 2024

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented Nov 7, 2024

Alternative approach for #3463

This is required for solving graphql-hive/console#5875 as the request can not be used as a internal cache key for batched requests.

Copy link

changeset-bot bot commented Nov 7, 2024

🦋 Changeset detected

Latest commit: 65c4ec6

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/plugin-persisted-operations Major
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-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

@n1ru4l n1ru4l force-pushed the feat-params-context branch 2 times, most recently from 1246771 to 4f592ca Compare November 7, 2024 15:50
Copy link
Contributor

github-actions bot commented Nov 7, 2024

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:

Copy link
Contributor

github-actions bot commented Nov 7, 2024

💻 Website Preview

The latest changes are available as preview in: https://d1ebd460.graphql-yoga.pages.dev

Copy link
Contributor

github-actions bot commented Nov 7, 2024

✅ 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% ✓ 512846      ✗ 0     
     data_received................................: 2.1 GB  14 MB/s
     data_sent....................................: 103 MB  687 kB/s
     http_req_blocked.............................: avg=1.5µs    min=982ns    med=1.31µs   max=243.78µs p(90)=2.02µs   p(95)=2.22µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=138.61µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=368.99µs min=222.2µs  med=330.17µs max=15.98ms  p(90)=471.75µs p(95)=493.96µs
       { expected_response:true }.................: avg=368.99µs min=222.2µs  med=330.17µs max=15.98ms  p(90)=471.75µs p(95)=493.96µs
     ✓ { mode:graphql-jit }.......................: avg=297.09µs min=222.2µs  med=273.39µs max=15.98ms  p(90)=305.4µs  p(95)=323.05µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=504.15µs min=407.37µs med=471.94µs max=9.88ms   p(90)=513.83µs p(95)=552.96µs
     ✓ { mode:graphql-response-cache }............: avg=349.67µs min=268.29µs med=329.64µs max=6.71ms   p(90)=360.71µs p(95)=373.3µs 
     ✓ { mode:graphql }...........................: avg=376.8µs  min=276.7µs  med=337.67µs max=13.84ms  p(90)=392.28µs p(95)=489.84µs
     ✓ { mode:uws }...............................: avg=354.91µs min=274.08µs med=330.42µs max=9.68ms   p(90)=364.56µs p(95)=383.24µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 256423
     http_req_receiving...........................: avg=34.31µs  min=16.66µs  med=34.08µs  max=6.01ms   p(90)=40.05µs  p(95)=42.45µs 
     http_req_sending.............................: avg=8.7µs    min=5.85µs   med=7.62µs   max=857.37µs p(90)=11.23µs  p(95)=12.45µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=325.97µs min=185.59µs med=288.31µs max=15.82ms  p(90)=427.75µs p(95)=447.57µs
     http_reqs....................................: 256423  1709.468359/s
     iteration_duration...........................: avg=579.98µs min=393.94µs med=537.79µs max=16.64ms  p(90)=687.57µs p(95)=715.93µs
     iterations...................................: 256423  1709.468359/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   

@n1ru4l n1ru4l force-pushed the feat-params-context branch from 4f592ca to 670bbc2 Compare November 7, 2024 16:29
@n1ru4l n1ru4l changed the title feat: pass context to inParams hook feat: pass context to onParams hook Nov 7, 2024
@n1ru4l n1ru4l marked this pull request as ready for review November 8, 2024 09:00
@n1ru4l n1ru4l requested review from EmrysMyrddin and ardatan and removed request for EmrysMyrddin November 8, 2024 09:00
@@ -0,0 +1,5 @@
---
'graphql-yoga': minor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are sure that the type change can't break any existing usage ? I always fear how TS handles generics when we add one like this ><'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has a default value, so it should be fine.

@n1ru4l n1ru4l merged commit 87ee333 into main Nov 8, 2024
34 checks passed
@n1ru4l n1ru4l deleted the feat-params-context branch November 8, 2024 09:20
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.

2 participants