Skip to content

Commit

Permalink
Fix compatibility with Ruby 2.6 and GraphQL 1.7
Browse files Browse the repository at this point in the history
Object.const_defined? returns true
defined? returns nil
  • Loading branch information
exAspArk committed Mar 4, 2019
1 parent 7c8adea commit 7fd7877
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/graphql/guard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def inline_type_guard(type)
GraphQL::Field.accepts_definitions(mask: GraphQL::Define.assign_metadata_key(:mask))
end

if Object.const_defined?('GraphQL::Schema::Object') && GraphQL::Schema::Object.respond_to?(:accepts_definition) # GraphQL-Ruby version >= 1.8
if defined?('GraphQL::Schema::Object') && GraphQL::Schema::Object.respond_to?(:accepts_definition) # GraphQL-Ruby version >= 1.8
GraphQL::Schema::Object.accepts_definition(:guard)
GraphQL::Schema::Field.accepts_definition(:guard)
GraphQL::Schema::Field.accepts_definition(:mask)
Expand Down

0 comments on commit 7fd7877

Please sign in to comment.