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

Use GraphQL Tools for Federation GW #3054

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

ardatan
Copy link
Collaborator

@ardatan ardatan commented Oct 10, 2023

Fixes #3015

@changeset-bot
Copy link

changeset-bot bot commented Oct 10, 2023

⚠️ No Changeset found

Latest commit: e76e069

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 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% ✓ 320046     ✗ 0     
     data_received................................: 1.3 GB  11 MB/s
     data_sent....................................: 65 MB   538 kB/s
     http_req_blocked.............................: avg=1.66µs   min=900ns    med=1.4µs    max=916.99µs p(90)=2.1µs    p(95)=2.4µs   
     http_req_connecting..........................: avg=6ns      min=0s       med=0s       max=698.19µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=504.82µs min=244.59µs med=401.39µs max=35.99ms  p(90)=748.39µs p(95)=801.08µs
       { expected_response:true }.................: avg=504.82µs min=244.59µs med=401.39µs max=35.99ms  p(90)=748.39µs p(95)=801.08µs
     ✓ { mode:graphql-jit }.......................: avg=356.38µs min=244.59µs med=313.49µs max=21.59ms  p(90)=373.19µs p(95)=423.03µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=816.82µs min=657.89µs med=744.29µs max=19.68ms  p(90)=846.8µs  p(95)=956.3µs 
     ✓ { mode:graphql-response-cache }............: avg=417.04µs min=290.49µs med=378.99µs max=12.96ms  p(90)=443.39µs p(95)=480.49µs
     ✓ { mode:graphql }...........................: avg=574.51µs min=427.49µs med=499.89µs max=35.99ms  p(90)=602.19µs p(95)=704.89µs
     http_req_failed..............................: 0.00%   ✓ 0          ✗ 160023
     http_req_receiving...........................: avg=28.23µs  min=14.99µs  med=24.2µs   max=4.76ms   p(90)=38.29µs  p(95)=43.5µs  
     http_req_sending.............................: avg=11.35µs  min=5.39µs   med=7.3µs    max=3.87ms   p(90)=13.6µs   p(95)=17.1µs  
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=465.23µs min=217.79µs med=360.69µs max=35.92ms  p(90)=713.29µs p(95)=755.89µs
     http_reqs....................................: 160023  1333.49903/s
     iteration_duration...........................: avg=744.33µs min=439.79µs med=651.69µs max=36.3ms   p(90)=979.89µs p(95)=1.06ms  
     iterations...................................: 160023  1333.49903/s
     vus..........................................: 1       min=1        max=1   
     vus_max......................................: 2       min=2        max=2   

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2023

💻 Website Preview

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 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.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/apollo-link 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/urql-exchange 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/redis-event-target 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
graphql-yoga 4.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs 2.2.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs-federation 2.3.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apollo-inline-trace 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apq 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-csrf-prevention 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-defer-stream 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-disable-introspection 1.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-graphql-sse 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-jwt 1.2.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-persisted-operations 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-prometheus 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-response-cache 2.3.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-sofa 2.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/render-graphiql 4.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎
@graphql-yoga/subscription 4.1.0-rc-20231013120111-e76e0697 npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 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:

Copy link
Contributor

@klippx klippx Oct 12, 2023

Choose a reason for hiding this comment

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

How is this file generated? Can you add some script in package.json that explains.

For instance, if today we are doing const supergraphSdl = new IntrospectAndCompose(options) from @apollo/gateway' how do we do that with @graphql-tools/federation. Can it be done programatically or has to be run as a script.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a script that uses our composition package; https://github.com/the-guild-org/federation
But you can keep using @apollo/gateway or Rover CLI

Choose a reason for hiding this comment

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

I suggest keeping the example in the docs as using @apollo/gateway and/or providing two examples, one using it and one relying on composition script/typeDefs like you have now.

Choose a reason for hiding this comment

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

I also wonder how one would use getStitchedSchemaFromSupergraphSdl with Apollo Gateway's pollIntervalInMs. Is that still possible without the envelope plugin?

@ardatan ardatan changed the title Use GraphQL Tools for Federation Use GraphQL Tools for Federation GW Oct 13, 2023
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.

Federation Subscriptions
3 participants