Skip to content

fix: add type annotations for function and make it typesafe #2310

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

Merged
merged 4 commits into from
Oct 9, 2024

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented Oct 9, 2024

No description provided.

Copy link

changeset-bot bot commented Oct 9, 2024

🦋 Changeset detected

Latest commit: e10dadc

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

This PR includes changesets to release 1 package
Name Type
@envelop/response-cache 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

@n1ru4l n1ru4l requested a review from EmrysMyrddin October 9, 2024 09:15
Copy link
Contributor

github-actions bot commented Oct 9, 2024

💻 Website Preview

The latest changes are available as preview in: https://f3672996.envelop.pages.dev

Copy link
Contributor

github-actions bot commented Oct 9, 2024

🚀 Snapshot Release (alpha)

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

Package Version Info
@envelop/immediate-introspection 4.0.0-alpha-20241009110811-e10dadc9d5dd8c669beefec15cd552f5b62a8558 npm ↗︎ unpkg ↗︎
@envelop/response-cache 6.2.2-alpha-20241009110811-e10dadc9d5dd8c669beefec15cd552f5b62a8558 npm ↗︎ unpkg ↗︎
@envelop/sentry 10.0.0-alpha-20241009110811-e10dadc9d5dd8c669beefec15cd552f5b62a8558 npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Collaborator

theguild-bot commented Oct 9, 2024

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.............................................: 100.00% ✓ 774206      ✗ 0     
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: 100.00% ✓ 165460      ✗ 0     
     ✓ { mode:envelop-cache-jit }.......................: 100.00% ✓ 340934      ✗ 0     
     ✓ { mode:envelop-just-cache }......................: 100.00% ✓ 165210      ✗ 0     
     ✓ { mode:graphql-js }..............................: 100.00% ✓ 102602      ✗ 0     
     data_received......................................: 3.0 GB  25 MB/s
     data_sent..........................................: 168 MB  1.4 MB/s
     envelop_init.......................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     envelop_total......................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     event_loop_lag.....................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     graphql_context....................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     graphql_execute....................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     graphql_parse......................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     graphql_validate...................................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     http_req_blocked...................................: avg=2.77µs  min=1.16µs   med=2.56µs  max=3.97ms  p(90)=3.29µs  p(95)=3.68µs 
     http_req_connecting................................: avg=22ns    min=0s       med=0s      max=1.5ms   p(90)=0s      p(95)=0s     
     http_req_duration..................................: avg=2.82ms  min=157.25µs med=2.79ms  max=39.1ms  p(90)=5.11ms  p(95)=6.06ms 
       { expected_response:true }.......................: avg=2.82ms  min=157.25µs med=2.79ms  max=39.1ms  p(90)=5.11ms  p(95)=6.06ms 
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=3.36ms  min=416.3µs  med=3.01ms  max=16.25ms p(90)=5.69ms  p(95)=6.19ms 
     ✓ { mode:envelop-cache-jit }.......................: avg=1.46ms  min=157.25µs med=1.21ms  max=16.63ms p(90)=2.46ms  p(95)=2.6ms  
     ✓ { mode:envelop-just-cache }......................: avg=3.36ms  min=412.14µs med=3ms     max=28.02ms p(90)=5.67ms  p(95)=6.16ms 
     ✓ { mode:graphql-js }..............................: avg=5.58ms  min=726.01µs med=4.83ms  max=39.1ms  p(90)=9.34ms  p(95)=10.1ms 
     http_req_failed....................................: 0.00%   ✓ 0           ✗ 387103
     http_req_receiving.................................: avg=34.99µs min=11.95µs  med=30.51µs max=11.89ms p(90)=46.37µs p(95)=50.05µs
     http_req_sending...................................: avg=12.75µs min=4.33µs   med=10.39µs max=15.59ms p(90)=19.66µs p(95)=20.9µs 
     http_req_tls_handshaking...........................: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     http_req_waiting...................................: avg=2.77ms  min=131.2µs  med=2.74ms  max=39.02ms p(90)=5.05ms  p(95)=6ms    
     http_reqs..........................................: 387103  3225.750995/s
     iteration_duration.................................: avg=3.09ms  min=344.43µs med=3.03ms  max=39.75ms p(90)=5.39ms  p(95)=6.32ms 
     iterations.........................................: 387103  3225.750995/s
     vus................................................: 10      min=10        max=10  
     vus_max............................................: 20      min=20        max=20  

Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin left a comment

Choose a reason for hiding this comment

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

I'm not against this change, but just for the context, the code was like this because we wanted to not adhere to any graphql engine. Which arguably, we already are...

@n1ru4l n1ru4l force-pushed the chore-response-cache-type-annotations branch from 8c56a2a to fc58099 Compare October 9, 2024 10:30
@n1ru4l n1ru4l force-pushed the chore-response-cache-type-annotations branch from 3dc8851 to 3c42878 Compare October 9, 2024 11:00
@n1ru4l n1ru4l changed the title chore: add type annotations for function and make it typesafe fix: add type annotations for function and make it typesafe Oct 9, 2024
@n1ru4l n1ru4l merged commit 9ddb3bd into main Oct 9, 2024
18 checks passed
@n1ru4l n1ru4l deleted the chore-response-cache-type-annotations branch October 9, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants