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

graphql / graphql-js / 2488
98%

Build:
DEFAULT BRANCH: master
Ran 14 Aug 2017 02:00AM UTC
Jobs 1
Files 163
Run time 7s
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

pending completion
2488

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

Jobs
ID Job ID Ran Files Coverage
1 2488.1 14 Aug 2017 02:00AM UTC 0
97.99
Travis Job 2488.1
Source Files on build 2488
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2488
  • 0779c36f on github
  • Prev Build on master (#2483)
  • Next Build on master (#2489)
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

© 2025 Coveralls, Inc