Skip to content

Commit

Permalink
Merge pull request #26 from exAspArk/ruby-2.6
Browse files Browse the repository at this point in the history
Make Ruby 2.6 and GraphQL 1.7 compatible
  • Loading branch information
exAspArk committed Mar 4, 2019
2 parents 84aea1f + dd415d3 commit 83ed52e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.4
2.6.1
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ matrix:
include:
- gemfile: graphql-1.7.gemfile
env: GRAPHQL_RUBY_VERSION=1_7 CI=true
rvm: 2.3.4
rvm: 2.3.8
- gemfile: graphql-1.8.gemfile
env: GRAPHQL_RUBY_VERSION=1_8 CI=true
rvm: 2.3.4
rvm: 2.3.8
- gemfile: graphql-1.7.gemfile
env: GRAPHQL_RUBY_VERSION=1_7 CI=true
rvm: 2.4.3
rvm: 2.4.5
- gemfile: graphql-1.8.gemfile
env: GRAPHQL_RUBY_VERSION=1_8 CI=true
rvm: 2.4.3
rvm: 2.4.5
- gemfile: graphql-1.7.gemfile
env: GRAPHQL_RUBY_VERSION=1_7 CI=true
rvm: 2.5.1
rvm: 2.5.3
- gemfile: graphql-1.8.gemfile
env: GRAPHQL_RUBY_VERSION=1_8 CI=true
rvm: 2.5.1
rvm: 2.5.3
- gemfile: graphql-1.7.gemfile
env: GRAPHQL_RUBY_VERSION=1_7 CI=true
rvm: 2.6.1
- gemfile: graphql-1.8.gemfile
env: GRAPHQL_RUBY_VERSION=1_8 CI=true
rvm: 2.6.1
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 83ed52e

Please sign in to comment.