Skip to content

Commit d851ad6

Browse files
committed
Fix bug with GQL 1.10
1 parent 4749c34 commit d851ad6

5 files changed

Lines changed: 41 additions & 1 deletion

File tree

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ gemfile:
2020
- gemfiles/rails5.1_graphql1.9.gemfile
2121
- gemfiles/rails5.2_graphql1.8.gemfile
2222
- gemfiles/rails5.2_graphql1.9.gemfile
23+
- gemfiles/rails5.2_graphql1.10.gemfile
2324

2425
jobs:
2526
include:
@@ -31,6 +32,10 @@ jobs:
3132
rvm: 2.5.7
3233
- gemfile: gemfiles/rails6.0_graphql1.9.gemfile
3334
rvm: 2.6.5
35+
- gemfile: gemfiles/rails6.0_graphql1.10.gemfile
36+
rvm: 2.5.7
37+
- gemfile: gemfiles/rails6.0_graphql1.10.gemfile
38+
rvm: 2.6.5
3439
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile
3540
rvm: 2.5.7
3641
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile

Appraisals

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ appraise 'rails5.2-graphql1.9' do
4747
gem 'graphql', '~> 1.9.0'
4848
end
4949

50+
appraise 'rails5.2-graphql1.10' do
51+
gem 'sqlite3', '~> 1.3.6'
52+
gem 'rails', github: 'rails/rails', branch: '5-2-stable'
53+
gem 'graphql', '~> 1.10.0'
54+
end
55+
5056
appraise 'rails6.0-graphql1.8' do
5157
gem 'sqlite3', '~> 1.4'
5258
gem 'devise', '>= 4.7'
@@ -61,6 +67,13 @@ appraise 'rails6.0-graphql1.9' do
6167
gem 'graphql', '~> 1.9.0'
6268
end
6369

70+
appraise 'rails6.0-graphql1.10' do
71+
gem 'sqlite3', '~> 1.4'
72+
gem 'devise', '>= 4.7'
73+
gem 'rails', github: 'rails/rails', branch: '6-0-stable'
74+
gem 'graphql', '~> 1.10.0'
75+
end
76+
6477
appraise 'rails_edge-graphql_edge' do
6578
gem 'sqlite3', '~> 1.4'
6679
gem 'devise_token_auth', github: 'lynndylanhurley/devise_token_auth', branch: 'master'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "sqlite3", "~> 1.3.6"
6+
gem "rails", github: "rails/rails", branch: "5-2-stable"
7+
gem "graphql", "~> 1.10.0"
8+
9+
gemspec path: "../"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "sqlite3", "~> 1.4"
6+
gem "devise", ">= 4.7"
7+
gem "rails", github: "rails/rails", branch: "6-0-stable"
8+
gem "graphql", "~> 1.10.0"
9+
10+
gemspec path: "../"

lib/graphql_devise/rails/routes.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def mount_graphql_devise_for(resource, opts = {})
6363
GraphqlDevise::Types::MutationType.field("#{mapping_name}_#{action}", mutation: used_mutation)
6464
end
6565

66-
GraphqlDevise::Schema.mutation(GraphqlDevise::Types::MutationType) if used_mutations.present?
66+
if used_mutations.present? &&
67+
(Gem::Version.new(GraphQL::VERSION) <= Gem::Version.new('1.10.0') || GraphqlDevise::Schema.mutation.nil?)
68+
GraphqlDevise::Schema.mutation(GraphqlDevise::Types::MutationType)
69+
end
6770

6871
used_queries = if only_operations.present?
6972
default_queries.slice(*only_operations)

0 commit comments

Comments
 (0)