Skip to content

feat(apollo-usage-report): report referenced feild by types #4020

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

EmrysMyrddin
Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin commented May 5, 2025

Related to YOGA-19
Related to #3580

Copy link

codesandbox bot commented May 5, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

github-actions bot commented May 5, 2025

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 May 5, 2025

💻 Website Preview

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

Copy link
Contributor

github-actions bot commented May 5, 2025

✅ 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% ✓ 444060      ✗ 0     
     data_received................................: 1.8 GB  12 MB/s
     data_sent....................................: 89 MB   595 kB/s
     http_req_blocked.............................: avg=1.64µs   min=1µs      med=1.4µs    max=5.63ms   p(90)=2.07µs   p(95)=2.31µs  
     http_req_connecting..........................: avg=4ns      min=0s       med=0s       max=462.53µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=444.71µs min=292.89µs med=407.04µs max=19.58ms  p(90)=575.2µs  p(95)=604.42µs
       { expected_response:true }.................: avg=444.71µs min=292.89µs med=407.04µs max=19.58ms  p(90)=575.2µs  p(95)=604.42µs
     ✓ { mode:graphql-jit }.......................: avg=378.24µs min=299.62µs med=358.97µs max=19.58ms  p(90)=397.11µs p(95)=415.02µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=604.24µs min=499.77µs med=576.51µs max=6.35ms   p(90)=635.53µs p(95)=715.6µs 
     ✓ { mode:graphql-response-cache }............: avg=439.35µs min=349.71µs med=420.43µs max=8.45ms   p(90)=457.07µs p(95)=471.96µs
     ✓ { mode:graphql }...........................: avg=466.32µs min=362.19µs med=434.28µs max=17.91ms  p(90)=498.16µs p(95)=555.92µs
     ✓ { mode:uws }...............................: avg=381.14µs min=292.89µs med=359.61µs max=6.44ms   p(90)=400.85µs p(95)=425.11µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 222030
     http_req_receiving...........................: avg=34.67µs  min=16.66µs  med=33.73µs  max=3.01ms   p(90)=40.8µs   p(95)=44.43µs 
     http_req_sending.............................: avg=9.46µs   min=6.18µs   med=8.73µs   max=329.46µs p(90)=12.04µs  p(95)=13.21µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=400.58µs min=262.07µs med=364.29µs max=19.43ms  p(90)=530.46µs p(95)=558.16µs
     http_reqs....................................: 222030  1480.182728/s
     iteration_duration...........................: avg=670.23µs min=478.4µs  med=629.38µs max=20.15ms  p(90)=802.52µs p(95)=836.67µs
     iterations...................................: 222030  1480.182728/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   

// Copied from https://github.com/apollographql/apollo-server/blob/8c6579e5b61276b62dc7e30e6fac9a4242e24daa/packages/server/src/plugin/usageReporting/stats.ts
/* eslint-disable */

import type { NonFtv1ErrorPath } from '@apollo/server-gateway-interface';
Copy link
Member

Choose a reason for hiding this comment

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

We can avoid this package entirely by copying this too, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we can. We discussed it on slack, and we decided that if the Licence allows it, and the dependency is small, it is ok to have it as a dependence.

That's why I've made a copy of the relevant part of the apollo-server code. I don't think it is worth to embed the whole apollo-server deps just for a class ^^'

hostname?: string;
/**
* The OS identification string.
* The format is `${os.platform()}, ${os.type()}, ${os.release()}, ${os.arch()})`
Copy link
Member

Choose a reason for hiding this comment

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

navigator.platform etc can be used in platform independent way, maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh I didn't know node had navigator API.
The thing I don't know is if Apollo is parsing this field or not. If it's paring the string, then we can't use navigator.platform.

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.

4 participants