The following are lists of the notable changes included with each release.
This is intended to help keep people informed about notable changes between
versions, as well as provide a rough history. Each item is prefixed with
one of the following labels: Added
, Changed
, Deprecated
,
Removed
, Fixed
, Security
. We also use Semantic Versioning
to manage the versions of this gem so
that you can set version constraints properly.
- WIP
v2.0.0 – 2020-04-20
Added
: support forgraphql
gem version>= 1.10
withInterpreter
. #39Removed
: support for previousgraphql
gem versions. #39
Breaking changes:
- Requires using
graphql
gem version>= 1.10.0
with Interpreter.
Before:
class Schema < GraphQL::Schema
query QueryType
mutation MutationType
use GraphQL::Guard.new
end
After:
class Schema < GraphQL::Schema
use GraphQL::Execution::Interpreter
use GraphQL::Analysis::AST
query QueryType
mutation MutationType
use GraphQL::Guard.new
end
- Use the actual type in the Policy object without
type.metadata[:type_class]
.
Before (with graphql
gem version >= 1.8
and class-based type definitions):
class GraphqlPolicy
def self.guard(type, field)
RULES.dig(type.metadata[:type_class], field)
end
end
After:
class GraphqlPolicy
def self.guard(type, field)
RULES.dig(type, field)
end
end
v1.3.1 – 2020-01-22
Fixed
: compatibility withgraphql
gem version 1.10. #36
v1.3.0 – 2019-10-24
Added
: More descriptive default error message forNotAuthorizedError
. #32
v1.2.2 – 2019-03-04
Fixed
: compatibility with Ruby 2.6 andgraphql
gem version 1.7. #26
v1.2.1 – 2018-10-18
Fixed
: compatibility with Ruby 2.5 andgraphql
gem version 1.7. #21
v1.2.0 – 2018-06-29
Added
: support forgraphql
gem version 1.8. #17
v1.1.0 – 2018-05-09
Added
: support tomask
fields depending on the context.
v1.0.0 – 2017-07-31
Changed
: guards for every*
field also accepts arguments:->(object, arguments, context) { ... }
:
Before:
GraphQL::ObjectType.define do name "Post" guard ->(obj, ctx) { ... } ... end
After:
GraphQL::ObjectType.define do name "Post" guard ->(obj, args, ctx) { ... } ... end
Changed
:.field_with_guard
fromgraphql/guard/testing
module accepts policy object as a second argument:
Before:
guard_object = GraphQL::Guard.new(policy_object: GraphqlPolicy) posts_field = QueryType.field_with_guard('posts', guard_object)
After:
posts_field = QueryType.field_with_guard('posts', GraphqlPolicy)
v0.4.0 – 2017-07-25
Added
: ability to testguard
lambdas via field.
v0.3.0 – 2017-07-19
Added
: ability to use custom error handlers.
v0.2.0 – 2017-07-19
Added
: support for object policies.
v0.1.0 – 2017-07-19
Added
: initial functional version with inline policies.