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

HTTP executor should error when both data and errors fields are empty #5902

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

enisdenjo
Copy link
Collaborator

No description provided.

Copy link

changeset-bot bot commented Feb 15, 2024

🦋 Changeset detected

Latest commit: 4d87479

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

This PR includes changesets to release 1 package
Name Type
@graphql-tools/executor-http 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

@enisdenjo enisdenjo changed the title Error when both data and errors fields are empty HTTP executor should error when both data and errors fields are empty Feb 15, 2024
Copy link
Contributor

github-actions bot commented Feb 15, 2024

🚀 Snapshot Release (alpha)

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

Package Version Info
@graphql-tools/executor-http 1.0.8-alpha-20240215113243-4d8747932cfbe6200d458cbc4175483cef2a1d01 npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Feb 15, 2024

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.........................: 100.00% ✓ 344       ✗ 0  
     data_received..................: 40 MB   4.0 MB/s
     data_sent......................: 147 kB  15 kB/s
     http_req_blocked...............: avg=3.83µs   min=2.01µs   med=2.54µs   max=177.25µs p(90)=3.84µs   p(95)=4.07µs  
     http_req_connecting............: avg=627ns    min=0s       med=0s       max=107.89µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=54.16ms  min=45.29ms  med=51.15ms  max=148.77ms p(90)=60.47ms  p(95)=86.2ms  
       { expected_response:true }...: avg=54.16ms  min=45.29ms  med=51.15ms  max=148.77ms p(90)=60.47ms  p(95)=86.2ms  
     http_req_failed................: 0.00%   ✓ 0         ✗ 172
     http_req_receiving.............: avg=129.95µs min=102.16µs med=123.53µs max=520.33µs p(90)=144.48µs p(95)=155.09µs
     http_req_sending...............: avg=25.33µs  min=17.62µs  med=24.99µs  max=60.06µs  p(90)=30.24µs  p(95)=34.45µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=54.01ms  min=45.16ms  med=51.01ms  max=148.44ms p(90)=60.32ms  p(95)=86.05ms 
     http_reqs......................: 172     17.156299/s
     iteration_duration.............: avg=58.27ms  min=49.21ms  med=55.15ms  max=155.05ms p(90)=65.83ms  p(95)=89.98ms 
     iterations.....................: 172     17.156299/s
     vus............................: 1       min=1       max=1
     vus_max........................: 1       min=1       max=1

Copy link
Contributor

github-actions bot commented Feb 15, 2024

💻 Website Preview

The latest changes are available as preview in: https://988885fa.graphql-tools.pages.dev

return JSON.parse(result);
const parsedResult = JSON.parse(result);
if (
parsedResult.data == null &&
Copy link

Choose a reason for hiding this comment

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

These need to check for undefined as well. E.g. the response is {notGraphql: true}

Copy link
Owner

@ardatan ardatan Feb 15, 2024

Choose a reason for hiding this comment

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

== null (not ===) should check for both undefined and null.

Copy link

Choose a reason for hiding this comment

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

👍 woops
I'm too used to strict typescript rules. No == for me :)

@enisdenjo enisdenjo merged commit 9d18cce into master Feb 15, 2024
30 checks passed
@enisdenjo enisdenjo deleted the empty-data-or-errors branch February 15, 2024 18:01
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.

3 participants