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

Tutorial example #3452

Open gilgardosh opened 2 weeks ago

gilgardosh commented 2 weeks ago

New example to match the current Yoga tutorial

changeset-bot[bot] commented 2 weeks ago

⚠️ No Changeset found

Latest commit: a60099b8254a05ec977144fb8f0e93618aa7b404

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[bot] commented 2 weeks 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 2 weeks ago
### 💻 Website Preview The latest changes are available as preview in: [https://fa4b2b77.graphql-yoga.pages.dev](https://fa4b2b77.graphql-yoga.pages.dev)
github-actions[bot] commented 2 weeks 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% ✓ 523196      ✗ 0     
     data_received................................: 2.1 GB  14 MB/s
     data_sent....................................: 105 MB  701 kB/s
     http_req_blocked.............................: avg=1.47µs   min=922ns    med=1.31µs   max=417.62µs p(90)=1.96µs   p(95)=2.14µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=202.4µs  p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=357.92µs min=216.84µs med=324.31µs max=15.36ms  p(90)=456.89µs p(95)=476.13µs
       { expected_response:true }.................: avg=357.92µs min=216.84µs med=324.31µs max=15.36ms  p(90)=456.89µs p(95)=476.13µs
     ✓ { mode:graphql-jit }.......................: avg=289.52µs min=216.84µs med=267.82µs max=15.36ms  p(90)=298.41µs p(95)=312.94µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=483.24µs min=400.3µs  med=459.16µs max=9.19ms   p(90)=496.75µs p(95)=526.04µs
     ✓ { mode:graphql-response-cache }............: avg=339.59µs min=267.14µs med=321.6µs  max=9.1ms    p(90)=350.83µs p(95)=361.74µs
     ✓ { mode:graphql }...........................: avg=367.49µs min=276.86µs med=334.31µs max=13.52ms  p(90)=388.25µs p(95)=431.93µs
     ✓ { mode:uws }...............................: avg=343.78µs min=273.11µs med=324.46µs max=9.09ms   p(90)=356.54µs p(95)=372.4µs 
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 261598
     http_req_receiving...........................: avg=33.05µs  min=16.68µs  med=33.2µs   max=5.72ms   p(90)=38.68µs  p(95)=40.76µs 
     http_req_sending.............................: avg=8.44µs   min=5.94µs   med=7.47µs   max=447.53µs p(90)=10.95µs  p(95)=11.74µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=316.41µs min=186.89µs med=283.49µs max=15.26ms  p(90)=414.9µs  p(95)=432.14µs
     http_reqs....................................: 261598  1743.963307/s
     iteration_duration...........................: avg=568.48µs min=384.99µs med=531.95µs max=15.87ms  p(90)=671.51µs p(95)=695.01µs
     iterations...................................: 261598  1743.963307/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   
gilgardosh commented 3 days ago

@n1ru4l I ended up merging it into the hackernews example. I intentionally split it into 2 commits: The first one is without the final stage, second is the complete thing - as the codegen "magic" in the last tutorial step makes stuff less upfront and harder to navigate. Maybe worth mark it as a bonus step and remove the last commit? what do you think?