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

[response-cache] update @envelop/response-cache with support of scope, defer and stream #2993

Merged
merged 15 commits into from
Sep 27, 2023

Conversation

EmrysMyrddin
Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin commented Sep 8, 2023

Adds support for the scope feature from Apollo's response cache plugin.

This PR is updating the underlying envelop plugin and fixes a bug preventing Envelop plugin to detect the presence of a session or not.

Fixes #3021

@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2023

🦋 Changeset detected

Latest commit: 3d56650

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

This PR includes changesets to release 2 packages
Name Type
@graphql-yoga/plugin-response-cache Minor
hello-world-benchmark 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
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Apollo Federation Subgraph Compatibility Results

Federation 1 SupportFederation 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
Copy link
Contributor

github-actions bot commented Sep 8, 2023

🚀 Snapshot Release (rc)

The latest changes of this PR are available as rc on npm (based on the declared changesets):

Package Version Info
graphql-yoga-cloud-run-guide 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/apollo-link 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/urql-exchange 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
graphql-yoga 4.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs 2.1.1-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs-federation 2.2.1-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apollo-inline-trace 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apq 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-csrf-prevention 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-defer-stream 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-disable-introspection 1.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-graphql-sse 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-jwt 1.0.2-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-persisted-operations 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-prometheus 2.0.6-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-response-cache 2.2.0-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-sofa 2.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎
@graphql-yoga/render-graphiql 4.0.5-rc-20230927210315-1d7e0ed7 npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

✅ 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}

     checks.......................................: 100.00% ✓ 347172      ✗ 0     
     data_received................................: 1.4 GB  12 MB/s
     data_sent....................................: 70 MB   584 kB/s
     http_req_blocked.............................: avg=1.47µs   min=900ns    med=1.3µs    max=681.99µs p(90)=1.8µs    p(95)=2µs     
     http_req_connecting..........................: avg=4ns      min=0s       med=0s       max=540.99µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=457.65µs min=233.59µs med=376.59µs max=25.88ms  p(90)=667.89µs p(95)=724.39µs
       { expected_response:true }.................: avg=457.65µs min=233.59µs med=376.59µs max=25.88ms  p(90)=667.89µs p(95)=724.39µs
     ✓ { mode:graphql-jit }.......................: avg=334.27µs min=233.59µs med=296.99µs max=16.34ms  p(90)=349.69µs p(95)=386.79µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=730.74µs min=587.29µs med=664.29µs max=17.91ms  p(90)=765.79µs p(95)=844.39µs
     ✓ { mode:graphql-response-cache }............: avg=392.96µs min=281.49µs med=360.09µs max=15.25ms  p(90)=413.39µs p(95)=446.99µs
     ✓ { mode:graphql }...........................: avg=483.56µs min=355.19µs med=422.09µs max=25.88ms  p(90)=508.3µs  p(95)=594.9µs 
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 173586
     http_req_receiving...........................: avg=25.59µs  min=14.6µs   med=21.9µs   max=6.48ms   p(90)=34.9µs   p(95)=38.29µs 
     http_req_sending.............................: avg=10.21µs  min=5.5µs    med=6.7µs    max=1.77ms   p(90)=11.9µs   p(95)=14.6µs  
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=421.84µs min=209.6µs  med=343.69µs max=25.82ms  p(90)=636.69µs p(95)=682.79µs
     http_reqs....................................: 173586  1446.529717/s
     iteration_duration...........................: avg=686.11µs min=423.59µs med=605.49µs max=26.17ms  p(90)=887.39µs p(95)=970.69µs
     iterations...................................: 173586  1446.529717/s
     vus..........................................: 0       min=0         max=1   
     vus_max......................................: 2       min=2         max=2   

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

💻 Website Preview

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

@EmrysMyrddin EmrysMyrddin force-pushed the feat/response-cache-scope-and-defer branch from 95c9b46 to 6ba0c1c Compare September 8, 2023 13:24
@EmrysMyrddin EmrysMyrddin changed the title [response-cache] support @cacheControl(scope: CacheControlScope) [response-cache] update @envelop/response-cache with support of scope, defer and stream Sep 8, 2023
@EmrysMyrddin EmrysMyrddin force-pushed the feat/response-cache-scope-and-defer branch 2 times, most recently from d817571 to bf956ae Compare September 8, 2023 15:38
@EmrysMyrddin EmrysMyrddin force-pushed the feat/response-cache-scope-and-defer branch from dd2d21e to 79cb3d3 Compare September 20, 2023 19:04
@theguild-bot theguild-bot mentioned this pull request Sep 27, 2023
@EmrysMyrddin EmrysMyrddin force-pushed the feat/response-cache-scope-and-defer branch from a852b45 to 1d7e0ed Compare September 27, 2023 20:32
@ardatan ardatan merged commit 0c6625a into main Sep 27, 2023
24 of 27 checks passed
@ardatan ardatan deleted the feat/response-cache-scope-and-defer branch September 27, 2023 21:11
This was referenced May 7, 2024
This was referenced May 23, 2024
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.

@graphql-yoga/plugin-response-cache not yielding context to buildResponseCacheKey
2 participants