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

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

Build:
DEFAULT BRANCH: master
Ran 04 Jun 2018 11:46PM UTC
Files 195
Run time 15s
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

04 Jun 2018 11:42PM UTC coverage: 98.73% (+0.008%) from 98.722%
3475.1

push

travis-ci

mjmahone
Add support for Symbol.toStringTag (#1297)

**Changes**
 * Add static and instance property getters for Symbol.toStringTag for
 each exported class.

**Purpose**
Being able to compare class and class instances via internal class type
as per the definition and usage of Symbol.toStringTag allows other
libraries to validate types during runtime in this manner. It also
prevents them from having to patch the live values in their own
codebases.

**Contrived Example**
With no modules and vanilla JavaScript we should be able to do something
like the following.

```javascript
let type = new GraphQLObjectType({name: 'Sample'});

if (({}).toString.call(type) === '[object GraphQLObjectType]') {
  // we have the right type of class
}
```

However, with libraries such as `type-detect` or `ne-types` the code can
look far cleaner.

```javascript
// type-detect
let type = require('type-detect')
let obj = new GraphQLObjectType({name:'Example'})
assert(type(obj) === GraphQLObjectType.name)

// ne-types
let { typeOf } = require('ne-types')
let obj = new GraphQLObjectType({name:'Example'})
assert(typeOf(obj) === GraphQLObjectType.name)
```

There are a lot of libraries out there, despite doing nearly the same
thing in all cases, that support the usage of `Symbol.toStringTag` and
by adding support for that in the base GraphQL classes, all of these
libraries can be used with GraphQL.

3385 of 3635 branches covered (93.12%)

10571 of 10707 relevant lines covered (98.73%)

1096.2 hits per line

Source Files on job 3475.1
  • Tree
  • List 0
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 3345
  • Travis Job 3475.1
  • e79faaa5 on github
  • Prev Job for on master (#3469.1)
  • Next Job for on master (#3476.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