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

GraphQL Yoga driver for NestJS GraphQL #2525

Merged
merged 41 commits into from
Mar 28, 2023
Merged

GraphQL Yoga driver for NestJS GraphQL #2525

merged 41 commits into from
Mar 28, 2023

Conversation

enisdenjo
Copy link
Collaborator

@enisdenjo enisdenjo commented Mar 2, 2023

Significant refactor and cleanup of https://github.com/enisdenjo/graphql-yoga-nestjs for v1.

TODO

BREAKING CHANGES

  • No more subscriptionWithFilter in YogaBaseDriver.
  • YogaBaseDriver.yogaInstance has been renamed to YogaBaseDriver.yoga
  • YogaBaseDriver has been renamed to AbstractYogaDriver
  • Drop @envelop/apollo-server-errors, if you want to use it - supply it to the plugins yourself
  • graphql is now a peer dependency
  • graphql-yoga is now a peer dependency
  • installSubscriptionHandlers driver option has been dropped, please use the subscriptions
    option
  • Apollo Federation v2 support
  • Apollo Federation driver has been moved to a separate package @graphql-yoga/nestjs-federation
  • Dropped support for @nestjs/graphql@v10, now at least v11 is required (Refactor schema generation to be independent of driver start nestjs/graphql#2435)
  • Minimum Node.js engine is v14

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2023

🦋 Changeset detected

Latest commit: f14235d

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/nestjs-federation Major
@graphql-yoga/nestjs Major

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 Mar 2, 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 Mar 2, 2023

🚀 Snapshot Release (alpha)

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

Package Version Info
@graphql-yoga/apollo-link 1.7.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/urql-exchange 1.7.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/common 3.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/graphiql 3.0.10-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
graphql-yoga 3.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs 1.0.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs-federation 1.0.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/node 3.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apollo-inline-trace 1.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apq 1.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-csrf-prevention 1.4.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-defer-stream 1.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-disable-introspection 0.7.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-graphql-sse 1.4.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-persisted-operations 1.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-prometheus 1.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-response-cache 1.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-sofa 1.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎
@graphql-yoga/render-graphiql 3.8.0-alpha-20230328132821-f14235d8 npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

❌ Benchmark Failed

Performance regression detected: it seems like your Pull Request adds some extra latency to GraphQL Yoga

If the performance regression is expected, please increase the failing threshold.

     ✓ 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% ✓ 198480     ✗ 0    
     data_received................................: 812 MB  6.8 MB/s
     data_sent....................................: 40 MB   334 kB/s
     http_req_blocked.............................: avg=2.92µs   min=1.5µs   med=2.29µs  max=2.91ms  p(90)=3µs      p(95)=3.5µs   
     http_req_connecting..........................: avg=48ns     min=0s      med=0s      max=2.02ms  p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=839.1µs  min=384.1µs med=684.3µs max=73.55ms p(90)=1.15ms   p(95)=1.31ms  
       { expected_response:true }.................: avg=839.1µs  min=384.1µs med=684.3µs max=73.55ms p(90)=1.15ms   p(95)=1.31ms  
     ✓ { mode:graphql-jit }.......................: avg=677.93µs min=384.1µs med=580.2µs max=27.63ms p(90)=742.21µs p(95)=909.32µs
     ✗ { mode:graphql-no-parse-validate-cache }...: avg=1.2ms    min=827µs   med=1.09ms  max=23.16ms p(90)=1.34ms   p(95)=1.78ms  
     ✓ { mode:graphql-response-cache }............: avg=720.15µs min=438.2µs med=628.9µs max=17.65ms p(90)=801.97µs p(95)=968.28µs
     ✓ { mode:graphql }...........................: avg=875.26µs min=488.3µs med=742.9µs max=73.55ms p(90)=999.9µs  p(95)=1.3ms   
     http_req_failed..............................: 0.00%   ✓ 0          ✗ 99240
     http_req_receiving...........................: avg=50.17µs  min=23.3µs  med=41.5µs  max=15.23ms p(90)=63.2µs   p(95)=82.4µs  
     http_req_sending.............................: avg=22.49µs  min=8.9µs   med=12.9µs  max=15.3ms  p(90)=25.2µs   p(95)=33.9µs  
     http_req_tls_handshaking.....................: avg=0s       min=0s      med=0s      max=0s      p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=766.43µs min=346.1µs med=619.4µs max=73.45ms p(90)=1.08ms   p(95)=1.22ms  
     http_reqs....................................: 99240   826.944888/s
     iteration_duration...........................: avg=1.19ms   min=644.2µs med=1.03ms  max=74ms    p(90)=1.52ms   p(95)=1.79ms  
     iterations...................................: 99240   826.944888/s
     vus..........................................: 1       min=1        max=1  
     vus_max......................................: 2       min=2        max=2  

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

💻 Website Preview

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

@enisdenjo enisdenjo force-pushed the nestjs branch 2 times, most recently from ca8f02b to d337489 Compare March 3, 2023 14:03
@enisdenjo enisdenjo force-pushed the nestjs branch 2 times, most recently from 4a716b4 to ca0ee01 Compare March 22, 2023 17:24
@enisdenjo enisdenjo marked this pull request as ready for review March 24, 2023 18:06
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