Releases: graphql/graphql-js
v0.7.0
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
andcontext
, 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 namedQuery
andMutation
(#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:
v0.6.2
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
orFloat
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
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:
v0.6.0
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:
v0.5.0
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
andexecute
functions now accept acontext
parameter which is distinct fromrootValue
and available as the third argument to allresolve
functions. The additional information is now the fourth argument toresolve
functions. Anyresolve
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 tonew 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
andleave
when editing the root node in an AST (#298) - Visitor helpers are now directly exported (5ea2ff1)
v0.5.0-beta.1
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
v0.4.17
v0.4.16
v0.4.15
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)