Skip to content

Commit

Permalink
Merge pull request #62 from graphql-devise/fix-bug-with-gql-1-10
Browse files Browse the repository at this point in the history
Fix bug with GQL 1.10
  • Loading branch information
mcelicalderon committed Feb 2, 2020
2 parents 4749c34 + d851ad6 commit 2382381
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ gemfile:
- gemfiles/rails5.1_graphql1.9.gemfile
- gemfiles/rails5.2_graphql1.8.gemfile
- gemfiles/rails5.2_graphql1.9.gemfile
- gemfiles/rails5.2_graphql1.10.gemfile

jobs:
include:
Expand All @@ -31,6 +32,10 @@ jobs:
rvm: 2.5.7
- gemfile: gemfiles/rails6.0_graphql1.9.gemfile
rvm: 2.6.5
- gemfile: gemfiles/rails6.0_graphql1.10.gemfile
rvm: 2.5.7
- gemfile: gemfiles/rails6.0_graphql1.10.gemfile
rvm: 2.6.5
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile
rvm: 2.5.7
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile
Expand Down
13 changes: 13 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ appraise 'rails5.2-graphql1.9' do
gem 'graphql', '~> 1.9.0'
end

appraise 'rails5.2-graphql1.10' do
gem 'sqlite3', '~> 1.3.6'
gem 'rails', github: 'rails/rails', branch: '5-2-stable'
gem 'graphql', '~> 1.10.0'
end

appraise 'rails6.0-graphql1.8' do
gem 'sqlite3', '~> 1.4'
gem 'devise', '>= 4.7'
Expand All @@ -61,6 +67,13 @@ appraise 'rails6.0-graphql1.9' do
gem 'graphql', '~> 1.9.0'
end

appraise 'rails6.0-graphql1.10' do
gem 'sqlite3', '~> 1.4'
gem 'devise', '>= 4.7'
gem 'rails', github: 'rails/rails', branch: '6-0-stable'
gem 'graphql', '~> 1.10.0'
end

appraise 'rails_edge-graphql_edge' do
gem 'sqlite3', '~> 1.4'
gem 'devise_token_auth', github: 'lynndylanhurley/devise_token_auth', branch: 'master'
Expand Down
9 changes: 9 additions & 0 deletions gemfiles/rails5.2_graphql1.10.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "sqlite3", "~> 1.3.6"
gem "rails", github: "rails/rails", branch: "5-2-stable"
gem "graphql", "~> 1.10.0"

gemspec path: "../"
10 changes: 10 additions & 0 deletions gemfiles/rails6.0_graphql1.10.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "sqlite3", "~> 1.4"
gem "devise", ">= 4.7"
gem "rails", github: "rails/rails", branch: "6-0-stable"
gem "graphql", "~> 1.10.0"

gemspec path: "../"
5 changes: 4 additions & 1 deletion lib/graphql_devise/rails/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def mount_graphql_devise_for(resource, opts = {})
GraphqlDevise::Types::MutationType.field("#{mapping_name}_#{action}", mutation: used_mutation)
end

GraphqlDevise::Schema.mutation(GraphqlDevise::Types::MutationType) if used_mutations.present?
if used_mutations.present? &&
(Gem::Version.new(GraphQL::VERSION) <= Gem::Version.new('1.10.0') || GraphqlDevise::Schema.mutation.nil?)
GraphqlDevise::Schema.mutation(GraphqlDevise::Types::MutationType)
end

used_queries = if only_operations.present?
default_queries.slice(*only_operations)
Expand Down

0 comments on commit 2382381

Please sign in to comment.