graphql v1.7.0 Release Notes
-
๐ฅ Breaking changes
GraphQL::Result
is the returned from GraphQL execution. #898Schema#execute
andQuery#result
both return aGraphQL::Result
. It implements Hash-like methods to preserve compatibility.
๐ New features
- ๐จ
puts ctx.backtrace
prints out a GraphQL backtrace table #946 GraphQL::Backtrace.enable
wraps unhandled errors with GraphQL backtraces #946GraphQL::Relay::ConnectionType.bidrectional_pagination = true
turns on true bi-directional pagination checks forhasNextPage
/hasPreviousPage
fields. This will become the default behavior in a future version. #960- Field arguments may be accessed as methods on the
args
object. This is an alternative to#[]
syntax which provides did-you-mean behavior instead of returningnil
on a typo. #924 For example:
# using hash syntax: args[:limit] # => 10 args[:limittt] # => nil # using method syntax: args.limit # => 10 args.limittt # => NoMethodError
The old syntax is not deprecated.
๐ Improvements to schema filters #919
- If a type is not referenced by anything, it's hidden
- If a type is an abstract type, but has no visible members, it's hidden
๐
GraphQL::Argument.define
builds re-usable arguments #948GraphQL::Subscriptions
provides hooks for subscription platforms #672GraphQL::Subscriptions::ActionCableSubscriptions
implements subscriptions over ActionCable #672More runtime values are accessble from a
ctx
object #923 :ctx.parent
returns thectx
from the parent fieldctx.object
returns the currentobj
for that fieldctx.value
returns the resolved GraphQL value for that field
These can be used together, for example,
ctx.parent.object
to get the parent object.- ๐
GraphQL::Tracing
provides more hooks into gem internals for performance monitoring #917 GraphQL::Result
provides access to the originalquery
andcontext
after executing a query #898
๐ Bug fixes
- Prevent passing both query string and parsed document to
Schema#execute
#957 - Prevent invalid names for types #947