graphql_devise 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b6f3ff9d48c3f0aead4020e78b67b67d4a4f006d0567e46c9d25e2d4ec75027
4
- data.tar.gz: c8b9e08819e1b67ee96728190a3a99063ad6370fb2764c14f5d7ab170ee8dbbc
3
+ metadata.gz: c2c83dfb6c9f669c409b21975688d9456715a599ca6239426dd1441cda422939
4
+ data.tar.gz: c9a1d90df7f63225678045d451b64982e1de08c474a6b2bbf2422bb0b5438c97
5
5
  SHA512:
6
- metadata.gz: 1492eb845e6ad50959eee321dbd0feb7efa2ebd8ff37784080715305e2d072109dd0575e2ecbb7ac584f868156a7c4d646101edc4962bc88a86d0005acbfc085
7
- data.tar.gz: 811254816bf9d2ca63d9064339c0d85bf7073ec7266953f2b8caa42e0be3924277a4a483c05bd7ff60326aeb284fb3632bd53fad2cf2912481c16d3d5d550368
6
+ metadata.gz: 65a4f0fe8950268893883195e2ac1c191080f1ff34e4f88dc2b856e3a69303f3b4218504540b7436e8803884ec69bf38a1e17b9ce6bcc18447232637ccf9e034
7
+ data.tar.gz: 97f3ede65094c97442b6cae271fe9b9b7800d1787095034e5296732b18ac4e771a3d62249668b5f21872897351cc0f2c8b5d18e3fdb604ff3832e60ef47a2bfa
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.8.1](https://github.com/graphql-devise/graphql_devise/tree/v0.8.1) (2019-11-27)
4
+
5
+ [Full Changelog](https://github.com/graphql-devise/graphql_devise/compare/v0.8.0...v0.8.1)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Add dummy query field if none is provided. Works when devise\_invitable is loaded [\#48](https://github.com/graphql-devise/graphql_devise/pull/48) ([mcelicalderon](https://github.com/mcelicalderon))
10
+
3
11
  ## [v0.8.0](https://github.com/graphql-devise/graphql_devise/tree/v0.8.0) (2019-11-26)
4
12
 
5
13
  [Full Changelog](https://github.com/graphql-devise/graphql_devise/compare/v0.7.0...v0.8.0)
@@ -0,0 +1,12 @@
1
+ module GraphqlDevise
2
+ module Resolvers
3
+ class Dummy < Base
4
+ type String, null: false
5
+ description 'Field necessary as at least one query must be present in the schema'
6
+
7
+ def resolve
8
+ 'Dummy field necessary as graphql-ruby gem requires at least one query to be present in the schema.'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,6 +1,5 @@
1
1
  module GraphqlDevise
2
2
  class Schema < GraphQL::Schema
3
- mutation(GraphqlDevise::Types::MutationType)
4
3
  query(GraphqlDevise::Types::QueryType)
5
4
  end
6
5
  end
@@ -36,7 +36,7 @@ module ActionDispatch::Routing
36
36
  devise_for(
37
37
  resource.pluralize.underscore.tr('/', '_').to_sym,
38
38
  module: :devise,
39
- skip: [:sessions, :registrations, :passwords, :confirmations, :omniauth_callbacks, :unlocks]
39
+ skip: [:sessions, :registrations, :passwords, :confirmations, :omniauth_callbacks, :unlocks, :invitations]
40
40
  )
41
41
 
42
42
  authenticatable_type = opts[:authenticatable_type] ||
@@ -63,6 +63,8 @@ module ActionDispatch::Routing
63
63
  GraphqlDevise::Types::MutationType.field("#{mapping_name}_#{action}", mutation: used_mutation)
64
64
  end
65
65
 
66
+ GraphqlDevise::Schema.mutation(GraphqlDevise::Types::MutationType) if used_mutations.present?
67
+
66
68
  used_queries = if only_operations.present?
67
69
  default_queries.slice(*only_operations)
68
70
  else
@@ -83,6 +85,10 @@ module ActionDispatch::Routing
83
85
  GraphqlDevise::Types::QueryType.field("#{mapping_name}_#{action}", resolver: used_query)
84
86
  end
85
87
 
88
+ if used_queries.blank? && GraphqlDevise::Types::QueryType.fields.blank?
89
+ GraphqlDevise::Types::QueryType.field(:dummy, resolver: GraphqlDevise::Resolvers::Dummy)
90
+ end
91
+
86
92
  Devise.mailer.helper(GraphqlDevise::MailerHelper)
87
93
 
88
94
  devise_scope mapping_name do
@@ -1,3 +1,3 @@
1
1
  module GraphqlDevise
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.8.1'.freeze
3
3
  end