Skip to content

Releases: graphql/graphql-js

v0.7.0

25 Aug 23:21
Compare
Choose a tag to compare

Thanks to many contributors, GraphQL v0.7.0 contains many improvements and a few new utilities for those building tools using graphql-js.

Most exciting is that the schema language is now more fully featured than ever and you can create new usable schemas directly from that language, making GraphQL easier to use than ever. Huge thanks to @lacker for his vision and effort in making this happen.

Breaking:

  • Default resolver behavior now provides args and context, allowing for more powerful resolvers on your existing data objects (#468 @lacker)
  • GraphQLError has been refactored to provide more information and behave more like the built-in Error object (8df7894)

New:

  • GraphQL schema documents can now specify descriptions via doc-block style comments (#463 #464)
  • Schema language documents no longer have to specify a schema declaration if their root types are named Query and Mutation (#470)
  • GraphQLSchema generated by referencing introspection, read from a schema language document, or extending an existing schema can now be used for execution (#469)

New Utilities:

  • buildSchema() is a utility for creating a usable GraphQLSchema directly from the GraphQL schema language (#471 @lacker)
  • separateOperations() is a utility for splitting up a GraphQL document with many operations into multiple smaller documents with one operation each (#456)

Fixed:

  • Extending a schema allows for defining new directives (#455 @robzhu)
  • The stack of a GraphQLError is now more predictable, improving compatibility with other libraries (#452 @RylanH)

v0.6.2

21 Jul 20:53
Compare
Choose a tag to compare

Thanks to the excellent contributions from community members both in the form
of code, careful review, and thoughtful discussion. This version of GraphQL
fixes a handful of issues

New:

  • Union type definitions may now accept list of possible Types as a "thunk". (#436 @ekosz)
  • List fields can now return any iterable collection, not limited to Array, including Backbone.Collection, or Immutable.js Lists. (#449, #300 @mwschall)

Fixed:

  • Ensure source code is only ASCII. (#429 @kassens)
  • astFromValue() now requires a Type as a second parameter and properly serializes Enums with different internal values. (#435 @nodkz)
  • GraphQLError.stack is now a writable property, fixing issues in Bluebird and other libraries which use a brand-check for Error. (#439 @alexturek)
  • GraphQLError.message, GraphQLError.locations, and GraphQLError.path are now enumerable properties, which means JSON.stringify() will now produce a value which is compliant with the GraphQL spec. (#426 @bnewtonius)
  • Field errors are now thrown when values are resolved for fields typed Int or Float which are not representable by those types, improving debugability and spec compliance. (#391 @stubailo)
  • Errors during field value completion (e.g. a value returned of an incorrect type) now include location information. (#445)

v0.6.1

06 Jul 23:07
Compare
Choose a tag to compare

Builds on npm are now smaller and dependency-free! This should make graphql easier to use in clients like Apollo and Relay.

New:

  • Execution errors now include a path property indicating the position in the response which produced the error. (#396)

Fixes:

  • No longer causes issues when included in a React Native project. (#414)
  • Better error reporting in edge cases thanks to improved Flow error checking. (c7700f2)

v0.6.0

10 May 22:08
Compare
Choose a tag to compare

This version introduces directives to the (still experimental) schema language and introduces a @deprecated directive for marking deprecated fields. It also improves validation error messages, thanks to @yuzhi and @robzhu.

New:

  • Schema Language Directives (#376, #382)
  • New @deprecated directive (#384)
  • Directive constructor and built-ins are now exported from the main module (#381)
  • Introspection types are now exported from the main module (71b6a4a)
  • Validation: improving overlapping fields quality, may detect new issues (#386)
  • Improve validation error message when field names conflict (#363)
  • Include possible names when validation fails (#355)
  • Error logging for new interface type semantics (#350)

Fixes:

  • Deepen introspection query from 3 levels to 7 (#364)
  • Printer now correct prints empty block lists (ea5b241)
  • Ensure buildASTSchema does not exclude @skip and @include (#380)

v0.5.0

08 Apr 02:01
Compare
Choose a tag to compare

This version is the first reference implementation fully compatible with GraphQL — April 2016. In addition to any relevant breaking changes from the spec, it also has made some breaking changes to its API.

Thanks so much to those who contributed issues and pull requests for your help in improving GraphQL!

Breaking:

  • The graphql and execute functions now accept a context parameter which is distinct from rootValue and available as the third argument to all resolve functions. The additional information is now the fourth argument to resolve functions. Any resolve function which currently uses the third argument will need to be updated in order to use this version of graphql-js. (#326)
  • Types can now be explicitly provided to new GraphQLSchema({ types: [...] }). Types which implement an interface but are otherwise not referenced as a field return type are no longer automatically added to the Schema! Provide types like this directly to new GraphQLSchema to ensure they are included in order to use this version of graphql-js. This fixes a long-standing bug which made it difficult to build multiple related Schema with the same type instances. (#327)
  • Spec compliance: Directives are now defined and introspected with an array of locations they can be legally placed, rather than a set of booleans. (#317)

New:

  • Spec compliance: Overlapping fields must have compatible response shapes (c034de9)
  • More support for the experimental schema IDL: (#325) (#323) (fdafe32)

Fixes:

  • Spec compliance: @skip and @include are now commutative. (#335) (47f87fa)
  • Experimental schema IDL no longer allows duplicate query types. (ffe76c5)
  • No longer sends incorrect error messages when a response name is not provided (#319)
  • Visitor now correctly encounters both enter and leave when editing the root node in an AST (#298)
  • Visitor helpers are now directly exported (5ea2ff1)

v0.5.0-beta.1

05 Apr 05:17
Compare
Choose a tag to compare

Many breaking changes which have been planned for some time were introduced in the last few weeks. This beta release should help you test support. A full description of changes will be outlined in the final release, please refer to the commit history for detailed information.

v0.4.18

09 Mar 02:26
Compare
Choose a tag to compare

New:

  • Adds validator to ensure variable names are unique (#296)

v0.4.17

09 Feb 08:26
Compare
Choose a tag to compare

Fixes:

  • Fix a case where the AST printer could erroneously exclude information from anonymous operations (#289)

v0.4.16

03 Feb 06:04
Compare
Choose a tag to compare

New:

  • Utilities for comparing GraphQL types are now exported directly. (aff18e6)

Fixes:

  • No longer parses documents which contain u2028 or u2029 characters, to comply with the spec. This is technically breaking, but these are so rare that I doubt anyone will encounter this.

v0.4.15

03 Feb 01:24
Compare
Choose a tag to compare

New:

  • The full GraphQL API is now exported from the top module. If you're building a tool that uses GraphQL.js, hopefully this makes it easier to import and use utilities in this library. (4547904)
  • Clearer error messages:
    • When a requested field cannot be found on an interface or union, we'll suggest an inline fragment. (#282)
    • When a variable isn't used, we'll include the name of the query that defined it.
    • When a field typed as List returns something that is not a list, the error will include the name of the type and field. (#276)
    • When an input type includes unknown information, ensure it's name is printed. (#261)