Skip to content

Releases: graphql/graphql-js

v0.8.1

11 Nov 21:55
Compare
Choose a tag to compare

Fixes:

  • Supports Flow v0.35
  • GraphQL parser now returns clearer error messages (07cc624)

v0.8.0

11 Nov 20:11
Compare
Choose a tag to compare

GraphQL.js v0.8.0 is now compliant with the most recent version of the GraphQL specification! This release is also the first to include flow types in the NPM package, which should make it easier to use GraphQL in a well typed way. It also includes many new utilities and small improvements. Thanks to everyone who helped with this release!

Breaking & Spec Changes:

  • A resolve function's info.path value is now a Linked List instead of an Array (#562)
  • A resolve function's info.fieldASTs value has been renamed to info.fieldNodes (#554)
  • formatError now includes the path of field errors (#561)
  • The most recent version of the GraphQL specification is more strict about field argument validation. (#553)
  • The most recent version of the GraphQL specification does not allow multiple directives of the same name in the same location (#552)

New:

  • GraphQL now supports a literal null value as a field argument. (#544)
  • Flow type definitions are now included in the NPM package! The names of many types were changed to be more descriptive. (#554, #526, #412)
  • printType lets you print a single GraphQL type using the experimental schema language (#558)
  • defaultResolver, the field resolver used when one is not provided, is now available (#527)

v0.7.2

11 Nov 19:57
Compare
Choose a tag to compare

New:

  • An Interface or Union's resolveType function may return a string type name instance of an instance (#509)
  • Adds utility for comparing schema for breaking changes (#508)

Fixes:

  • No longer includes holes in the locations of a GraphQL Error (#507)

v0.7.1

29 Sep 06:01
Compare
Choose a tag to compare

New:

  • Adds parseType method, which allows for parsing type references independently of whole GraphQL documents (#506)
  • Adds isDeprecated field to type definition API, making it easier to use within tools (#496 @asiandrummer)

Fixes:

  • Allows GraphQL Errors to be configurable, fixing compatibility issues with Bluebird Promises (#505 @darthtrevino)
  • Fix bug where locations go missing when the error comes from something at the beginning of the file (#487 @martijnwalraven)
  • Supports Promises-A (in addition to Promises-A+) which improves support with older libraries (#481)
  • No longer accept empty string as a valid Int/Float value. (#477 @robzhu)
  • Provide clearer error message when variables are provided as an unparsed string. (f2f3db5)

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.