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

graphql / graphql-js / 1077
98%
master: 98%

Build:
Build:
LAST BUILD BRANCH: directives
DEFAULT BRANCH: master
Ran 19 Jul 2016 09:51PM UTC
Jobs 1
Files 137
Run time 10s
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
1077

push

travis-ci

leebyron
[FIX] astFromValue uses `serialize()` and requires type.

A bug was reported in #435 and reproduced in #438 which illustrates an issue where defaultValue would serialize incorrectly or even throw an invariant violation when working with input objects or enums backed by values other than their names.

The root of the issue is that astFromValue accepts an *internal* value, but then produces an AST directly from that value without serializing it to an *external* value first via calling `type.serialize(value)`. This critical missing step is responsible for the reported issue.

In order to fix correctly, this refactored this method to be a closer dual to [`valueFromAST`](https://github.com/graphql/graphql-js/blob/master/src/utilities/valueFromAST.js), relying on the GraphQL type rather than the JavaScript type to guide coercion. As a consequence, `astFromValue` now *requires* a type rather than accepting one optionally.

76 of 76 new or added lines in 5 files covered. (100.0%)

7178 of 7302 relevant lines covered (98.3%)

1371.15 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
100.0
src/utilities/astFromValue.js
Jobs
ID Job ID Ran Files Coverage
1 1077.1 19 Jul 2016 09:51PM UTC 0
98.3
Travis Job 1077.1
Source Files on build 1077
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1077
  • db46ca97 on github
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