envelop
envelop copied to clipboard
feat: create graphql-executor plugin
Create GraphQL-executor plugin
Related #976
🦋 Changeset detected
Latest commit: d7dd95fe440bce38ad60cf7210e8d369643f9c1e
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @envelop/graphql-executor | Minor |
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
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/theguild/envelop/GzxBbVc6sQLoFPD4N1YdzQmUCr4N
✅ Preview: https://envelop-git-issue-976-theguild.vercel.app
The latest changes of this PR are available as alpha in npm (based on the declared changesets):
@envelop/[email protected]
@yaacovCR thoughts anything I should change on this?
✅ Benchmark Results
✓ no_errors
✓ expected_result
checks.............................................: 100.00% ✓ 619102 ✗ 0
data_received......................................: 2.4 GB 16 MB/s
data_sent..........................................: 135 MB 898 kB/s
envelop_init.......................................: avg=527ns min=99ns med=299ns max=1.92ms p(90)=799ns p(95)=2.1µs
✓ { mode:envelop-cache-jit }.......................: avg=337ns min=99ns med=300ns max=1.92ms p(90)=500ns p(95)=699ns
✓ { mode:envelop-just-cache }......................: avg=256ns min=99ns med=200ns max=36.2µs p(90)=399ns p(95)=500ns
✓ { mode:graphql-js }..............................: avg=536ns min=99ns med=300ns max=1.05ms p(90)=1.79µs p(95)=2.3µs
✓ { mode:prom-tracing }............................: avg=2.94µs min=1.5µs med=2.1µs max=307.3µs p(90)=5.4µs p(95)=7.2µs
envelop_total......................................: avg=196.43µs min=0s med=20.19µs max=16.19ms p(90)=436.8µs p(95)=1.48ms
✓ { mode:envelop-cache-jit }.......................: avg=20.67µs min=15.89µs med=18.9µs max=9.18ms p(90)=25.29µs p(95)=28.39µs
✓ { mode:envelop-just-cache }......................: avg=175.83µs min=154.8µs med=169.9µs max=9.77ms p(90)=183.1µs p(95)=192.6µs
✓ { mode:graphql-js }..............................: avg=475.57µs min=392.6µs med=431.4µs max=13.57ms p(90)=474.7µs p(95)=516.61µs
✓ { mode:prom-tracing }............................: avg=1.65ms min=1.44ms med=1.51ms max=16.19ms p(90)=1.64ms p(95)=2.72ms
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
✓ { mode:prom-tracing }............................: avg=0s min=0s med=0s max=0s p(90)=0s p(95)=0s
graphql_context....................................: avg=3.48µs min=1.69µs med=2.6µs max=7.17ms p(90)=5.2µs p(95)=6.9µs
✓ { mode:envelop-cache-jit }.......................: avg=2.53µs min=1.69µs med=2.29µs max=2.27ms p(90)=3.29µs p(95)=4µs
✓ { mode:envelop-just-cache }......................: avg=2.91µs min=1.99µs med=2.6µs max=7.17ms p(90)=3.19µs p(95)=3.79µs
✓ { mode:graphql-js }..............................: avg=5.29µs min=3.39µs med=4.39µs max=4.52ms p(90)=7.7µs p(95)=9µs
✓ { mode:prom-tracing }............................: avg=7.41µs min=5.89µs med=6.89µs max=2.27ms p(90)=7.79µs p(95)=9.2µs
graphql_execute....................................: avg=200.78µs min=8.39µs med=154.2µs max=15.89ms p(90)=179.9µs p(95)=1.44ms
✓ { mode:envelop-cache-jit }.......................: avg=10.63µs min=8.39µs med=9.69µs max=9.18ms p(90)=11.9µs p(95)=13.29µs
✓ { mode:envelop-just-cache }......................: avg=165.62µs min=146.3µs med=160.4µs max=9.75ms p(90)=171.1µs p(95)=180.9µs
✓ { mode:graphql-js }..............................: avg=181.61µs min=151.2µs med=162.8µs max=11.28ms p(90)=175.4µs p(95)=186.4µs
✓ { mode:prom-tracing }............................: avg=1.58ms min=1.38ms med=1.45ms max=15.89ms p(90)=1.56ms p(95)=2.65ms
graphql_parse......................................: avg=9.55µs min=3.39µs med=4.89µs max=8.04ms p(90)=14.8µs p(95)=46.8µs
✓ { mode:envelop-cache-jit }.......................: avg=5.22µs min=3.39µs med=4.89µs max=4.71ms p(90)=6.5µs p(95)=7.5µs
✓ { mode:envelop-just-cache }......................: avg=5µs min=3.49µs med=4.49µs max=3.92ms p(90)=5.59µs p(95)=6.4µs
✓ { mode:graphql-js }..............................: avg=12.38µs min=8.19µs med=10.2µs max=5.71ms p(90)=16.39µs p(95)=18.5µs
✓ { mode:prom-tracing }............................: avg=50.35µs min=42.49µs med=48µs max=8.04ms p(90)=55µs p(95)=60.3µs
graphql_validate...................................: avg=50.79µs min=1.39µs med=1.9µs max=13.35ms p(90)=251.7µs p(95)=258.2µs
✓ { mode:envelop-cache-jit }.......................: avg=1.93µs min=1.39µs med=1.8µs max=1.27ms p(90)=2.3µs p(95)=2.6µs
✓ { mode:envelop-just-cache }......................: avg=2.02µs min=1.4µs med=1.89µs max=1.08ms p(90)=2.19µs p(95)=2.39µs
✓ { mode:graphql-js }..............................: avg=275.74µs min=220µs med=252.7µs max=13.35ms p(90)=275.3µs p(95)=298.1µs
✓ { mode:prom-tracing }............................: avg=6.61µs min=4.79µs med=5.69µs max=4.43ms p(90)=7.09µs p(95)=8.5µs
http_req_blocked...................................: avg=2.87µs min=600ns med=1.3µs max=9.39ms p(90)=1.9µs p(95)=2.29µs
http_req_connecting................................: avg=193ns min=0s med=0s max=3.57ms p(90)=0s p(95)=0s
http_req_duration..................................: avg=4.46ms min=195.7µs med=2.8ms max=86.83ms p(90)=9.79ms p(95)=15.64ms
{ expected_response:true }.......................: avg=4.46ms min=195.7µs med=2.8ms max=86.83ms p(90)=9.79ms p(95)=15.64ms
✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=3.43ms min=380.6µs med=2.71ms max=53.38ms p(90)=5.6ms p(95)=6.49ms
✓ { mode:envelop-cache-jit }.......................: avg=2.61ms min=195.7µs med=1.99ms max=27.04ms p(90)=4.93ms p(95)=9.18ms
✓ { mode:envelop-just-cache }......................: avg=3.63ms min=386.6µs med=2.8ms max=39.49ms p(90)=5.98ms p(95)=7.85ms
✓ { mode:graphql-js }..............................: avg=6.99ms min=733.11µs med=5.44ms max=70.31ms p(90)=11.39ms p(95)=12.78ms
✓ { mode:prom-tracing }............................: avg=18.46ms min=2.12ms med=16.44ms max=86.83ms p(90)=31.72ms p(95)=33.15ms
http_req_failed....................................: 0.00% ✓ 0 ✗ 309551
http_req_receiving.................................: avg=47.36µs min=11.5µs med=21.5µs max=20.48ms p(90)=31.1µs p(95)=37.9µs
http_req_sending...................................: avg=36.89µs min=4.59µs med=7.8µs max=28.49ms p(90)=14.7µs p(95)=24.7µs
http_req_tls_handshaking...........................: avg=0s min=0s med=0s max=0s p(90)=0s p(95)=0s
http_req_waiting...................................: avg=4.37ms min=164.7µs med=2.76ms max=86.77ms p(90)=9.43ms p(95)=15.38ms
http_reqs..........................................: 309551 2063.541106/s
iteration_duration.................................: avg=4.83ms min=425.4µs med=3.11ms max=87.17ms p(90)=10.65ms p(95)=16.16ms
iterations.........................................: 309551 2063.541106/s
vus................................................: 1 min=1 max=10
vus_max............................................: 20 min=20 max=20
@saihaj can you please add it to the website plugin hub? :)
Methods are going to change soon with next release, might want to wait a bit for that. Primary method for all operations including subscriptions will just be execute.
also not sure whether it pays in docs to describe how you can use exported execute method or the internal class
also the readme will hopefully change soon as well with the examples and also you reflect actual defer/stream support, inlining text from there is fine, just making a note that might require maintenance
i am currently planning on releasing as v1 with the above changes but may stick with v0.x not sure
@yaacovCR so I updated to new version and ran into issue with the types between TypeExecutionArgs vs ExecutionArgs which I think I can just force it but the other issue it is complaining about different versions graphql-js
The latest changes of this PR are available as alpha in npm (based on the declared changesets):
@envelop/[email protected]
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| envelop | ✅ Ready (Inspect) | Visit Preview | Jul 13, 2022 at 2:08AM (UTC) |
this gives more customizable/extensible and agnostic solution https://github.com/n1ru4l/envelop/pull/1487