• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

graphql / graphql-js / 2488 / 1
98%
master: 98%

Build:
DEFAULT BRANCH: master
Ran 14 Aug 2017 02:00AM UTC
Files 163
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Aug 2017 01:58AM UTC coverage: 97.991% (-0.03%) from 98.018%
2488.1

push

travis-ci

leebyron
Update subscribe function to return a Promise of AsyncIterator or ExecutionResult (#918)

* Report or Reject when encountering Errors.

Currently the `subscribe()` function throws Errors, however this is awkward when used along with async functions which would expect a rejected iteration to represent failure. Also GraphQLErrors should be reported back to the client since they represent client-provided errors.

Updates test cases to represent this new behavior.

Includes a new utility `asyncIteratorReject`, and extends the behavior of `mapAsyncIterator` to help implement this.

* Subscriptions: Respond with error when failing to create source

If a subscribe resolve function throws or returns an error, that typically indicates an issue to be returned to the requesting client. This coerces errors into located GraphQLErrors so they are correctly reported.

* Subscriptions: Test source errors and execution errors.

After discussion in #868, decided that errors emitted from a source event stream should be considered "internal" errors and pass through.

However errors encountered during GraphQL execution on a source event should be considered "field" or "query" errors and be represented within that Response.

* Update subscribe signature to return a promise of AsyncIterator/Error/ExecutionResult

* Throw errors instead of returning them from Subscribe()

* Lint, refactor error mapper and add comments

* Report or Reject when encountering Errors.

Currently the `subscribe()` function throws Errors, however this is awkward when used along with async functions which would expect a rejected iteration to represent failure. Also GraphQLErrors should be reported back to the client since they represent client-provided errors.

Updates test cases to represent this new behavior.

Includes a new utility `asyncIteratorReject`, and extends the behavior of `mapAsyncIterator` to help implement this.

* Subscriptions: Respond with error when failing to create source

If a subscribe resolve function throws or returns an error, that typically indicates an issue to be returned to the requesting client. This coerces errors into located GraphQLErrors so they are correctly reported.

* Subscriptions: Test source errors and execution errors.

After discussion in #868, decided that errors emitted from a source event stream should be considered "internal" errors and pass through.

However errors encountered during GraphQL execution on a source event should be considered "field" or "query" errors and be represented within that Response.

* Update subscribe signature to return a promise of AsyncIterator/Error/ExecutionResult

* Throw errors instead of returning them from Subscribe()

* Lint, refactor error mapper and add comments

* Update test case assertions for stream errors to be more precise

* Add test case for wrong variable types

* Fix lint error (extra spaces)

* Fix multi-line doc block format

* Minor edits

* Trim trailing whitespace

3770 of 4246 branches covered (88.79%)

9170 of 9358 relevant lines covered (97.99%)

1249.8 hits per line

Source Files on job 2488.1
  • Tree
  • List 0
  • Changed 24
  • Source Changed 4
  • Coverage Changed 24
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 2488
  • Travis Job 2488.1
  • 0779c36f on github
  • Prev Job for on master (#2483.1)
  • Next Job for on master (#2489.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc