graphql_devise 0.11.2 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.rspec +1 -0
- data/.travis.yml +9 -3
- data/CHANGELOG.md +50 -1
- data/README.md +185 -32
- data/app/controllers/graphql_devise/application_controller.rb +4 -1
- data/app/controllers/graphql_devise/concerns/set_user_by_token.rb +25 -0
- data/app/controllers/graphql_devise/graphql_controller.rb +2 -0
- data/app/helpers/graphql_devise/mailer_helper.rb +2 -2
- data/app/views/graphql_devise/mailer/confirmation_instructions.html.erb +1 -1
- data/app/views/graphql_devise/mailer/reset_password_instructions.html.erb +1 -1
- data/config/locales/en.yml +1 -0
- data/config/routes.rb +2 -0
- data/graphql_devise.gemspec +6 -4
- data/lib/generators/graphql_devise/install_generator.rb +63 -30
- data/lib/graphql_devise.rb +24 -10
- data/lib/graphql_devise/default_operations/mutations.rb +6 -6
- data/lib/graphql_devise/default_operations/resolvers.rb +2 -2
- data/lib/graphql_devise/errors/authentication_error.rb +7 -0
- data/lib/graphql_devise/{detailed_user_error.rb → errors/detailed_user_error.rb} +1 -1
- data/lib/graphql_devise/errors/error_codes.rb +6 -0
- data/lib/graphql_devise/errors/execution_error.rb +4 -0
- data/lib/graphql_devise/{user_error.rb → errors/user_error.rb} +1 -1
- data/lib/graphql_devise/mount_method/operation_preparer.rb +2 -2
- data/lib/graphql_devise/mount_method/operation_preparers/default_operation_preparer.rb +6 -2
- data/lib/graphql_devise/mount_method/operation_preparers/gql_name_setter.rb +1 -1
- data/lib/graphql_devise/mount_method/operation_preparers/mutation_field_setter.rb +3 -2
- data/lib/graphql_devise/mount_method/operation_preparers/resolver_type_setter.rb +1 -1
- data/lib/graphql_devise/mount_method/operation_preparers/resource_name_setter.rb +2 -2
- data/lib/graphql_devise/mutations/resend_confirmation.rb +3 -5
- data/lib/graphql_devise/mutations/send_password_reset.rb +5 -2
- data/lib/graphql_devise/mutations/sign_up.rb +3 -6
- data/lib/graphql_devise/rails/routes.rb +5 -72
- data/lib/graphql_devise/resource_loader.rb +87 -0
- data/lib/graphql_devise/schema_plugin.rb +106 -0
- data/lib/graphql_devise/version.rb +1 -1
- data/spec/dummy/app/controllers/api/v1/graphql_controller.rb +41 -3
- data/spec/dummy/app/controllers/application_controller.rb +1 -0
- data/spec/dummy/app/graphql/dummy_schema.rb +18 -0
- data/spec/dummy/app/graphql/interpreter_schema.rb +9 -0
- data/spec/dummy/app/graphql/types/mutation_type.rb +1 -1
- data/spec/dummy/app/graphql/types/query_type.rb +10 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/generators/graphql_devise/install_generator_spec.rb +62 -30
- data/spec/rails_helper.rb +4 -1
- data/spec/requests/graphql_controller_spec.rb +80 -0
- data/spec/requests/mutations/resend_confirmation_spec.rb +44 -29
- data/spec/requests/mutations/send_password_reset_spec.rb +40 -12
- data/spec/requests/queries/confirm_account_spec.rb +7 -1
- data/spec/requests/user_controller_spec.rb +189 -24
- data/spec/services/mount_method/operation_preparer_spec.rb +8 -3
- data/spec/services/mount_method/operation_preparers/custom_operation_preparer_spec.rb +1 -1
- data/spec/services/mount_method/operation_preparers/default_operation_preparer_spec.rb +15 -8
- data/spec/services/mount_method/operation_preparers/mutation_field_setter_spec.rb +18 -4
- data/spec/services/mount_method/operation_preparers/resource_name_setter_spec.rb +1 -1
- data/spec/services/resource_loader_spec.rb +82 -0
- data/spec/services/schema_plugin_spec.rb +26 -0
- data/spec/spec_helper.rb +1 -1
- metadata +107 -89
- data/lib/graphql_devise/error_codes.rb +0 -5
- data/spec/support/generators/file_helpers.rb +0 -12
@@ -4,7 +4,7 @@ RSpec.describe GraphqlDevise::MountMethod::OperationPreparer do
|
|
4
4
|
describe '#call' do
|
5
5
|
subject(:prepared_operations) do
|
6
6
|
described_class.new(
|
7
|
-
|
7
|
+
mapping_name: mapping,
|
8
8
|
selected_operations: selected,
|
9
9
|
preparer: preparer,
|
10
10
|
custom: custom,
|
@@ -13,11 +13,16 @@ RSpec.describe GraphqlDevise::MountMethod::OperationPreparer do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
let(:logout_class) { Class.new(GraphQL::Schema::Resolver) }
|
16
|
-
let(:
|
17
|
-
let(:selected) { { login: double(:login_default), logout: logout_class } }
|
16
|
+
let(:mapping) { :user }
|
18
17
|
let(:preparer) { double(:preparer, call: logout_class) }
|
19
18
|
let(:custom) { { login: double(:custom_login, graphql_name: nil) } }
|
20
19
|
let(:additional) { { user_additional: double(:user_additional) } }
|
20
|
+
let(:selected) do
|
21
|
+
{
|
22
|
+
login: { klass: double(:login_default) },
|
23
|
+
logout:{ klass: logout_class }
|
24
|
+
}
|
25
|
+
end
|
21
26
|
|
22
27
|
it 'is expected to return all provided operation keys' do
|
23
28
|
expect(prepared_operations.keys).to contain_exactly(
|
@@ -6,7 +6,7 @@ RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::CustomOperationPr
|
|
6
6
|
|
7
7
|
let(:login_operation) { double(:confirm_operation, graphql_name: nil) }
|
8
8
|
let(:logout_operation) { double(:sign_up_operation, graphql_name: nil) }
|
9
|
-
let(:mapping_name) {
|
9
|
+
let(:mapping_name) { :user }
|
10
10
|
let(:operations) { { login: login_operation, logout: logout_operation, invalid: double(:invalid) } }
|
11
11
|
let(:selected_keys) { [:login, :logout, :sign_up, :confirm] }
|
12
12
|
|
@@ -9,20 +9,27 @@ RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::DefaultOperationP
|
|
9
9
|
let(:sign_up_operation) { double(:sign_up_operation, graphql_name: nil) }
|
10
10
|
let(:login_operation) { double(:confirm_operation, graphql_name: nil) }
|
11
11
|
let(:logout_operation) { double(:sign_up_operation, graphql_name: nil) }
|
12
|
-
let(:mapping_name) {
|
12
|
+
let(:mapping_name) { :user }
|
13
13
|
let(:preparer) { double(:preparer) }
|
14
|
-
let(:operations) { { login: login_operation, logout: logout_operation, sign_up: sign_up_operation, confirm: confirm_operation } }
|
15
14
|
let(:custom_keys) { [:login, :logout] }
|
15
|
+
let(:operations) do
|
16
|
+
{
|
17
|
+
confirm: { klass: confirm_operation, authenticatable: false },
|
18
|
+
sign_up: { klass: sign_up_operation, authenticatable: true },
|
19
|
+
login: { klass: login_operation, authenticatable: true },
|
20
|
+
logout: { klass: logout_operation, authenticatable: true }
|
21
|
+
}
|
22
|
+
end
|
16
23
|
|
17
24
|
before do
|
18
25
|
allow(default_preparer).to receive(:child_class).with(confirm_operation).and_return(confirm_operation)
|
19
26
|
allow(default_preparer).to receive(:child_class).with(sign_up_operation).and_return(sign_up_operation)
|
20
27
|
allow(default_preparer).to receive(:child_class).with(login_operation).and_return(login_operation)
|
21
28
|
allow(default_preparer).to receive(:child_class).with(logout_operation).and_return(logout_operation)
|
22
|
-
allow(preparer).to receive(:call).with(confirm_operation).and_return(confirm_operation)
|
23
|
-
allow(preparer).to receive(:call).with(sign_up_operation).and_return(sign_up_operation)
|
24
|
-
allow(preparer).to receive(:call).with(login_operation).and_return(login_operation)
|
25
|
-
allow(preparer).to receive(:call).with(logout_operation).and_return(logout_operation)
|
29
|
+
allow(preparer).to receive(:call).with(confirm_operation, authenticatable: false).and_return(confirm_operation)
|
30
|
+
allow(preparer).to receive(:call).with(sign_up_operation, authenticatable: true).and_return(sign_up_operation)
|
31
|
+
allow(preparer).to receive(:call).with(login_operation, authenticatable: true).and_return(login_operation)
|
32
|
+
allow(preparer).to receive(:call).with(logout_operation, authenticatable: true).and_return(logout_operation)
|
26
33
|
end
|
27
34
|
|
28
35
|
it 'returns only those operations with no custom operation provided' do
|
@@ -32,8 +39,8 @@ RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::DefaultOperationP
|
|
32
39
|
it 'prepares default operations' do
|
33
40
|
expect(confirm_operation).to receive(:graphql_name).with('UserConfirm')
|
34
41
|
expect(sign_up_operation).to receive(:graphql_name).with('UserSignUp')
|
35
|
-
expect(preparer).to receive(:call).with(confirm_operation)
|
36
|
-
expect(preparer).to receive(:call).with(sign_up_operation)
|
42
|
+
expect(preparer).to receive(:call).with(confirm_operation, authenticatable: false)
|
43
|
+
expect(preparer).to receive(:call).with(sign_up_operation, authenticatable: true)
|
37
44
|
|
38
45
|
prepared
|
39
46
|
|
@@ -2,15 +2,29 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::MutationFieldSetter do
|
4
4
|
describe '#call' do
|
5
|
-
subject(:prepared_operation) { described_class.new(field_type).call(operation) }
|
5
|
+
subject(:prepared_operation) { described_class.new(field_type).call(operation, authenticatable: authenticatable) }
|
6
6
|
|
7
7
|
let(:operation) { double(:operation) }
|
8
8
|
let(:field_type) { double(:type) }
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
context 'when resource is authtenticable' do
|
11
|
+
let(:authenticatable) { true }
|
12
12
|
|
13
|
-
|
13
|
+
it 'sets a field for the mutation' do
|
14
|
+
expect(operation).to receive(:field).with(:authenticatable, field_type, null: false)
|
15
|
+
|
16
|
+
prepared_operation
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when resource is *NOT* authtenticable' do
|
21
|
+
let(:authenticatable) { false }
|
22
|
+
|
23
|
+
it 'does *NOT* set a field for the mutation' do
|
24
|
+
expect(operation).not_to receive(:field)
|
25
|
+
|
26
|
+
prepared_operation
|
27
|
+
end
|
14
28
|
end
|
15
29
|
end
|
16
30
|
end
|
@@ -5,7 +5,7 @@ RSpec.describe GraphqlDevise::MountMethod::OperationPreparers::ResourceNameSette
|
|
5
5
|
subject(:prepared_operation) { described_class.new(mapping_name).call(operation) }
|
6
6
|
|
7
7
|
let(:operation) { double(:operation) }
|
8
|
-
let(:mapping_name) {
|
8
|
+
let(:mapping_name) { :user }
|
9
9
|
|
10
10
|
it 'sets a gql name to the operation' do
|
11
11
|
expect(prepared_operation.instance_variable_get(:@resource_name)).to eq(:user)
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe GraphqlDevise::ResourceLoader do
|
4
|
+
describe '#call' do
|
5
|
+
subject(:loader) { described_class.new(resource, options, routing).call(query, mutation) }
|
6
|
+
|
7
|
+
let(:query) { class_double(GraphQL::Schema::Object) }
|
8
|
+
let(:mutation) { class_double(GraphQL::Schema::Object) }
|
9
|
+
let(:routing) { false }
|
10
|
+
let(:mounted) { false }
|
11
|
+
let(:resource) { 'User' }
|
12
|
+
let(:options) { { only: [:login, :confirm_account] } }
|
13
|
+
|
14
|
+
before do
|
15
|
+
allow(GraphqlDevise).to receive(:add_mapping).with(:user, resource)
|
16
|
+
allow(GraphqlDevise).to receive(:resource_mounted?).with(:user).and_return(mounted)
|
17
|
+
allow(GraphqlDevise).to receive(:mount_resource).with(:user)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'loads operations into the provided types' do
|
21
|
+
expect(query).to receive(:field).with(:user_confirm_account, resolver: instance_of(Class), authenticate: false)
|
22
|
+
expect(mutation).to receive(:field).with(:user_login, mutation: instance_of(Class), authenticate: false)
|
23
|
+
expect(GraphqlDevise).to receive(:add_mapping).with(:user, resource)
|
24
|
+
expect(GraphqlDevise).not_to receive(:mount_resource)
|
25
|
+
|
26
|
+
returned = loader
|
27
|
+
|
28
|
+
expect(returned).to be_a(Struct)
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'when mutation is nil' do
|
32
|
+
let(:mutation) { nil }
|
33
|
+
|
34
|
+
it 'raises an error' do
|
35
|
+
expect { loader }.to raise_error(
|
36
|
+
GraphqlDevise::Error,
|
37
|
+
'You need to provide a mutation type unless all mutations are skipped'
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'when query is nil' do
|
43
|
+
let(:query) { nil }
|
44
|
+
|
45
|
+
before { allow(mutation).to receive(:field) }
|
46
|
+
|
47
|
+
it 'raises an error' do
|
48
|
+
expect { loader }.to raise_error(
|
49
|
+
GraphqlDevise::Error,
|
50
|
+
'You need to provide a query type unless all queries are skipped'
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'when invoked from router' do
|
56
|
+
let(:routing) { true }
|
57
|
+
|
58
|
+
before do
|
59
|
+
allow(query).to receive(:field)
|
60
|
+
allow(mutation).to receive(:field)
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'adds mappings' do
|
64
|
+
expect(GraphqlDevise).to receive(:add_mapping).with(:user, resource)
|
65
|
+
expect(GraphqlDevise).to receive(:mount_resource).with(:user)
|
66
|
+
|
67
|
+
loader
|
68
|
+
end
|
69
|
+
|
70
|
+
context 'when resource was already mounted' do
|
71
|
+
before { allow(GraphqlDevise).to receive(:resource_mounted?).with(:user).and_return(true) }
|
72
|
+
|
73
|
+
it 'skips schema loading' do
|
74
|
+
expect(query).not_to receive(:field)
|
75
|
+
expect(mutation).not_to receive(:field)
|
76
|
+
expect(GraphqlDevise).not_to receive(:add_mapping).with(:user, resource)
|
77
|
+
expect(GraphqlDevise).not_to receive(:mount_resource)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe GraphqlDevise::SchemaPlugin do
|
4
|
+
describe '#call' do
|
5
|
+
subject(:plugin) { described_class.new(query: query, mutation: mutation, resource_loaders: loaders) }
|
6
|
+
|
7
|
+
let(:query) { instance_double(GraphQL::Schema::Object) }
|
8
|
+
let(:mutation) { instance_double(GraphQL::Schema::Object) }
|
9
|
+
|
10
|
+
context 'when loaders are not provided' do
|
11
|
+
let(:loaders) { [] }
|
12
|
+
|
13
|
+
it 'does not fail' do
|
14
|
+
expect { plugin }.not_to raise_error
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'when a loaders is not an instance of loader' do
|
19
|
+
let(:loaders) { ['not a loader instance'] }
|
20
|
+
|
21
|
+
it 'raises an error' do
|
22
|
+
expect { plugin }.to raise_error(GraphqlDevise::Error, 'Invalid resource loader instance')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql_devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Celi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise_token_auth
|
@@ -18,6 +18,9 @@ dependencies:
|
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 0.1.43
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '2.0'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -25,6 +28,9 @@ dependencies:
|
|
25
28
|
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: 0.1.43
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: graphql
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -32,6 +38,9 @@ dependencies:
|
|
32
38
|
- - ">="
|
33
39
|
- !ruby/object:Gem::Version
|
34
40
|
version: '1.8'
|
41
|
+
- - "<"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.11.0
|
35
44
|
type: :runtime
|
36
45
|
prerelease: false
|
37
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -39,6 +48,9 @@ dependencies:
|
|
39
48
|
- - ">="
|
40
49
|
- !ruby/object:Gem::Version
|
41
50
|
version: '1.8'
|
51
|
+
- - "<"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.11.0
|
42
54
|
- !ruby/object:Gem::Dependency
|
43
55
|
name: rails
|
44
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,6 +58,9 @@ dependencies:
|
|
46
58
|
- - ">="
|
47
59
|
- !ruby/object:Gem::Version
|
48
60
|
version: '4.2'
|
61
|
+
- - "<"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '6.2'
|
49
64
|
type: :runtime
|
50
65
|
prerelease: false
|
51
66
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -53,6 +68,9 @@ dependencies:
|
|
53
68
|
- - ">="
|
54
69
|
- !ruby/object:Gem::Version
|
55
70
|
version: '4.2'
|
71
|
+
- - "<"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '6.2'
|
56
74
|
- !ruby/object:Gem::Dependency
|
57
75
|
name: appraisal
|
58
76
|
requirement: !ruby/object:Gem::Requirement
|
@@ -290,9 +308,12 @@ files:
|
|
290
308
|
- lib/graphql_devise/concerns/controller_methods.rb
|
291
309
|
- lib/graphql_devise/default_operations/mutations.rb
|
292
310
|
- lib/graphql_devise/default_operations/resolvers.rb
|
293
|
-
- lib/graphql_devise/detailed_user_error.rb
|
294
311
|
- lib/graphql_devise/engine.rb
|
295
|
-
- lib/graphql_devise/
|
312
|
+
- lib/graphql_devise/errors/authentication_error.rb
|
313
|
+
- lib/graphql_devise/errors/detailed_user_error.rb
|
314
|
+
- lib/graphql_devise/errors/error_codes.rb
|
315
|
+
- lib/graphql_devise/errors/execution_error.rb
|
316
|
+
- lib/graphql_devise/errors/user_error.rb
|
296
317
|
- lib/graphql_devise/mount_method/operation_preparer.rb
|
297
318
|
- lib/graphql_devise/mount_method/operation_preparers/custom_operation_preparer.rb
|
298
319
|
- lib/graphql_devise/mount_method/operation_preparers/default_operation_preparer.rb
|
@@ -323,12 +344,13 @@ files:
|
|
323
344
|
- lib/graphql_devise/resolvers/check_password_token.rb
|
324
345
|
- lib/graphql_devise/resolvers/confirm_account.rb
|
325
346
|
- lib/graphql_devise/resolvers/dummy.rb
|
347
|
+
- lib/graphql_devise/resource_loader.rb
|
326
348
|
- lib/graphql_devise/schema.rb
|
349
|
+
- lib/graphql_devise/schema_plugin.rb
|
327
350
|
- lib/graphql_devise/types/authenticatable_type.rb
|
328
351
|
- lib/graphql_devise/types/credential_type.rb
|
329
352
|
- lib/graphql_devise/types/mutation_type.rb
|
330
353
|
- lib/graphql_devise/types/query_type.rb
|
331
|
-
- lib/graphql_devise/user_error.rb
|
332
354
|
- lib/graphql_devise/version.rb
|
333
355
|
- spec/dummy/README.md
|
334
356
|
- spec/dummy/Rakefile
|
@@ -336,6 +358,7 @@ files:
|
|
336
358
|
- spec/dummy/app/controllers/api/v1/graphql_controller.rb
|
337
359
|
- spec/dummy/app/controllers/application_controller.rb
|
338
360
|
- spec/dummy/app/graphql/dummy_schema.rb
|
361
|
+
- spec/dummy/app/graphql/interpreter_schema.rb
|
339
362
|
- spec/dummy/app/graphql/mutations/login.rb
|
340
363
|
- spec/dummy/app/graphql/mutations/register_confirmed_user.rb
|
341
364
|
- spec/dummy/app/graphql/mutations/sign_up.rb
|
@@ -384,7 +407,6 @@ files:
|
|
384
407
|
- spec/dummy/config/routes.rb
|
385
408
|
- spec/dummy/config/secrets.yml
|
386
409
|
- spec/dummy/config/spring.rb
|
387
|
-
- spec/dummy/db/development.sqlite3
|
388
410
|
- spec/dummy/db/migrate/20190815114303_create_users.rb
|
389
411
|
- spec/dummy/db/migrate/20190824215150_add_auth_available_to_users.rb
|
390
412
|
- spec/dummy/db/migrate/20190916012505_create_admins.rb
|
@@ -392,11 +414,7 @@ files:
|
|
392
414
|
- spec/dummy/db/migrate/20200321121807_create_users_customers.rb
|
393
415
|
- spec/dummy/db/schema.rb
|
394
416
|
- spec/dummy/db/seeds.rb
|
395
|
-
- spec/dummy/db/test.sqlite3
|
396
|
-
- spec/dummy/log/development.log
|
397
|
-
- spec/dummy/log/test.log
|
398
417
|
- spec/dummy/public/robots.txt
|
399
|
-
- spec/dummy/tmp/development_secret.txt
|
400
418
|
- spec/factories/admins.rb
|
401
419
|
- spec/factories/guests.rb
|
402
420
|
- spec/factories/users.rb
|
@@ -405,6 +423,7 @@ files:
|
|
405
423
|
- spec/graphql_devise_spec.rb
|
406
424
|
- spec/models/user_spec.rb
|
407
425
|
- spec/rails_helper.rb
|
426
|
+
- spec/requests/graphql_controller_spec.rb
|
408
427
|
- spec/requests/mutations/additional_mutations_spec.rb
|
409
428
|
- spec/requests/mutations/additional_queries_spec.rb
|
410
429
|
- spec/requests/mutations/login_spec.rb
|
@@ -433,10 +452,11 @@ files:
|
|
433
452
|
- spec/services/mount_method/option_validators/skip_only_validator_spec.rb
|
434
453
|
- spec/services/mount_method/option_validators/supported_operations_validator_spec.rb
|
435
454
|
- spec/services/mount_method/options_validator_spec.rb
|
455
|
+
- spec/services/resource_loader_spec.rb
|
456
|
+
- spec/services/schema_plugin_spec.rb
|
436
457
|
- spec/spec_helper.rb
|
437
458
|
- spec/support/contexts/graphql_request.rb
|
438
459
|
- spec/support/factory_bot.rb
|
439
|
-
- spec/support/generators/file_helpers.rb
|
440
460
|
- spec/support/matchers/auth_headers_matcher.rb
|
441
461
|
- spec/support/matchers/not_change_matcher.rb
|
442
462
|
- spec/support/requests/auth_helpers.rb
|
@@ -462,119 +482,117 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
462
482
|
- !ruby/object:Gem::Version
|
463
483
|
version: '0'
|
464
484
|
requirements: []
|
465
|
-
rubygems_version: 3.
|
485
|
+
rubygems_version: 3.1.4
|
466
486
|
signing_key:
|
467
487
|
specification_version: 4
|
468
488
|
summary: GraphQL queries and mutations on top of devise_token_auth
|
469
489
|
test_files:
|
470
|
-
- spec/
|
471
|
-
- spec/dummy/
|
472
|
-
- spec/dummy/app/
|
473
|
-
- spec/dummy/app/
|
474
|
-
- spec/dummy/app/
|
475
|
-
- spec/dummy/app/
|
476
|
-
- spec/dummy/app/
|
477
|
-
- spec/dummy/app/models/user.rb
|
478
|
-
- spec/dummy/app/graphql/types/custom_admin_type.rb
|
479
|
-
- spec/dummy/app/graphql/types/mutation_type.rb
|
480
|
-
- spec/dummy/app/graphql/types/query_type.rb
|
481
|
-
- spec/dummy/app/graphql/types/base_object.rb
|
482
|
-
- spec/dummy/app/graphql/types/user_type.rb
|
483
|
-
- spec/dummy/app/graphql/mutations/register_confirmed_user.rb
|
490
|
+
- spec/dummy/README.md
|
491
|
+
- spec/dummy/Rakefile
|
492
|
+
- spec/dummy/app/assets/config/manifest.js
|
493
|
+
- spec/dummy/app/controllers/api/v1/graphql_controller.rb
|
494
|
+
- spec/dummy/app/controllers/application_controller.rb
|
495
|
+
- spec/dummy/app/graphql/dummy_schema.rb
|
496
|
+
- spec/dummy/app/graphql/interpreter_schema.rb
|
484
497
|
- spec/dummy/app/graphql/mutations/login.rb
|
498
|
+
- spec/dummy/app/graphql/mutations/register_confirmed_user.rb
|
485
499
|
- spec/dummy/app/graphql/mutations/sign_up.rb
|
486
500
|
- spec/dummy/app/graphql/resolvers/public_user.rb
|
487
501
|
- spec/dummy/app/graphql/resolvers/user_show.rb
|
488
|
-
- spec/dummy/app/graphql/
|
502
|
+
- spec/dummy/app/graphql/types/base_object.rb
|
503
|
+
- spec/dummy/app/graphql/types/custom_admin_type.rb
|
504
|
+
- spec/dummy/app/graphql/types/mutation_type.rb
|
505
|
+
- spec/dummy/app/graphql/types/query_type.rb
|
506
|
+
- spec/dummy/app/graphql/types/user_type.rb
|
489
507
|
- spec/dummy/app/jobs/application_job.rb
|
490
|
-
- spec/dummy/app/
|
491
|
-
- spec/dummy/app/
|
508
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
509
|
+
- spec/dummy/app/models/admin.rb
|
510
|
+
- spec/dummy/app/models/application_record.rb
|
511
|
+
- spec/dummy/app/models/guest.rb
|
512
|
+
- spec/dummy/app/models/user.rb
|
513
|
+
- spec/dummy/app/models/users.rb
|
514
|
+
- spec/dummy/app/models/users/customer.rb
|
492
515
|
- spec/dummy/app/views/layouts/mailer.html.erb
|
493
516
|
- spec/dummy/app/views/layouts/mailer.text.erb
|
494
|
-
- spec/dummy/app/assets/config/manifest.js
|
495
|
-
- spec/dummy/bin/update
|
496
|
-
- spec/dummy/bin/rake
|
497
|
-
- spec/dummy/bin/setup
|
498
517
|
- spec/dummy/bin/bundle
|
499
518
|
- spec/dummy/bin/rails
|
500
|
-
- spec/dummy/
|
501
|
-
- spec/dummy/
|
502
|
-
- spec/dummy/
|
503
|
-
- spec/dummy/config
|
504
|
-
- spec/dummy/config/environments/test.rb
|
505
|
-
- spec/dummy/config/spring.rb
|
506
|
-
- spec/dummy/config/master.key
|
507
|
-
- spec/dummy/config/environment.rb
|
519
|
+
- spec/dummy/bin/rake
|
520
|
+
- spec/dummy/bin/setup
|
521
|
+
- spec/dummy/bin/update
|
522
|
+
- spec/dummy/config.ru
|
508
523
|
- spec/dummy/config/application.rb
|
509
|
-
- spec/dummy/config/puma.rb
|
510
524
|
- spec/dummy/config/credentials.yml.enc
|
511
525
|
- spec/dummy/config/database.yml
|
526
|
+
- spec/dummy/config/environment.rb
|
527
|
+
- spec/dummy/config/environments/development.rb
|
528
|
+
- spec/dummy/config/environments/production.rb
|
529
|
+
- spec/dummy/config/environments/test.rb
|
512
530
|
- spec/dummy/config/initializers/application_controller_renderer.rb
|
513
531
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
532
|
+
- spec/dummy/config/initializers/cors.rb
|
533
|
+
- spec/dummy/config/initializers/devise.rb
|
514
534
|
- spec/dummy/config/initializers/devise_token_auth.rb
|
515
|
-
- spec/dummy/config/initializers/mime_types.rb
|
516
535
|
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
517
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
518
536
|
- spec/dummy/config/initializers/i18n.rb
|
519
|
-
- spec/dummy/config/initializers/devise.rb
|
520
537
|
- spec/dummy/config/initializers/inflections.rb
|
521
|
-
- spec/dummy/config/initializers/
|
522
|
-
- spec/dummy/config.
|
523
|
-
- spec/dummy/
|
524
|
-
- spec/dummy/
|
525
|
-
- spec/dummy/
|
526
|
-
- spec/dummy/
|
527
|
-
- spec/dummy/
|
528
|
-
- spec/dummy/db/
|
538
|
+
- spec/dummy/config/initializers/mime_types.rb
|
539
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
540
|
+
- spec/dummy/config/master.key
|
541
|
+
- spec/dummy/config/puma.rb
|
542
|
+
- spec/dummy/config/routes.rb
|
543
|
+
- spec/dummy/config/secrets.yml
|
544
|
+
- spec/dummy/config/spring.rb
|
545
|
+
- spec/dummy/db/migrate/20190815114303_create_users.rb
|
546
|
+
- spec/dummy/db/migrate/20190824215150_add_auth_available_to_users.rb
|
529
547
|
- spec/dummy/db/migrate/20190916012505_create_admins.rb
|
530
548
|
- spec/dummy/db/migrate/20191013213045_create_guests.rb
|
531
549
|
- spec/dummy/db/migrate/20200321121807_create_users_customers.rb
|
532
|
-
- spec/dummy/db/
|
533
|
-
- spec/dummy/db/
|
534
|
-
- spec/dummy/
|
535
|
-
- spec/
|
536
|
-
- spec/
|
537
|
-
- spec/
|
550
|
+
- spec/dummy/db/schema.rb
|
551
|
+
- spec/dummy/db/seeds.rb
|
552
|
+
- spec/dummy/public/robots.txt
|
553
|
+
- spec/factories/admins.rb
|
554
|
+
- spec/factories/guests.rb
|
555
|
+
- spec/factories/users.rb
|
556
|
+
- spec/factories/users_customers.rb
|
557
|
+
- spec/generators/graphql_devise/install_generator_spec.rb
|
538
558
|
- spec/graphql_devise_spec.rb
|
539
559
|
- spec/models/user_spec.rb
|
540
|
-
- spec/
|
560
|
+
- spec/rails_helper.rb
|
561
|
+
- spec/requests/graphql_controller_spec.rb
|
562
|
+
- spec/requests/mutations/additional_mutations_spec.rb
|
563
|
+
- spec/requests/mutations/additional_queries_spec.rb
|
541
564
|
- spec/requests/mutations/login_spec.rb
|
542
565
|
- spec/requests/mutations/logout_spec.rb
|
566
|
+
- spec/requests/mutations/resend_confirmation_spec.rb
|
543
567
|
- spec/requests/mutations/send_password_reset_spec.rb
|
544
|
-
- spec/requests/mutations/update_password_spec.rb
|
545
|
-
- spec/requests/mutations/additional_mutations_spec.rb
|
546
|
-
- spec/requests/mutations/additional_queries_spec.rb
|
547
568
|
- spec/requests/mutations/sign_up_spec.rb
|
548
|
-
- spec/requests/mutations/
|
549
|
-
- spec/requests/queries/confirm_account_spec.rb
|
569
|
+
- spec/requests/mutations/update_password_spec.rb
|
550
570
|
- spec/requests/queries/check_password_token_spec.rb
|
551
|
-
- spec/
|
552
|
-
- spec/
|
553
|
-
- spec/support/requests/auth_helpers.rb
|
554
|
-
- spec/support/requests/json_helpers.rb
|
555
|
-
- spec/support/generators/file_helpers.rb
|
556
|
-
- spec/support/matchers/not_change_matcher.rb
|
557
|
-
- spec/support/matchers/auth_headers_matcher.rb
|
558
|
-
- spec/factories/admins.rb
|
559
|
-
- spec/factories/users.rb
|
560
|
-
- spec/factories/guests.rb
|
561
|
-
- spec/factories/users_customers.rb
|
562
|
-
- spec/generators/graphql_devise/install_generator_spec.rb
|
563
|
-
- spec/rails_helper.rb
|
564
|
-
- spec/services/mount_method/option_sanitizers/class_checker_spec.rb
|
565
|
-
- spec/services/mount_method/option_sanitizers/array_checker_spec.rb
|
566
|
-
- spec/services/mount_method/option_sanitizers/hash_checker_spec.rb
|
567
|
-
- spec/services/mount_method/option_sanitizers/string_checker_spec.rb
|
568
|
-
- spec/services/mount_method/option_sanitizer_spec.rb
|
569
|
-
- spec/services/mount_method/options_validator_spec.rb
|
571
|
+
- spec/requests/queries/confirm_account_spec.rb
|
572
|
+
- spec/requests/user_controller_spec.rb
|
570
573
|
- spec/services/mount_method/operation_preparer_spec.rb
|
571
|
-
- spec/services/mount_method/operation_preparers/
|
574
|
+
- spec/services/mount_method/operation_preparers/custom_operation_preparer_spec.rb
|
572
575
|
- spec/services/mount_method/operation_preparers/default_operation_preparer_spec.rb
|
576
|
+
- spec/services/mount_method/operation_preparers/gql_name_setter_spec.rb
|
577
|
+
- spec/services/mount_method/operation_preparers/mutation_field_setter_spec.rb
|
573
578
|
- spec/services/mount_method/operation_preparers/resolver_type_setter_spec.rb
|
574
579
|
- spec/services/mount_method/operation_preparers/resource_name_setter_spec.rb
|
575
|
-
- spec/services/mount_method/
|
576
|
-
- spec/services/mount_method/
|
577
|
-
- spec/services/mount_method/
|
580
|
+
- spec/services/mount_method/operation_sanitizer_spec.rb
|
581
|
+
- spec/services/mount_method/option_sanitizer_spec.rb
|
582
|
+
- spec/services/mount_method/option_sanitizers/array_checker_spec.rb
|
583
|
+
- spec/services/mount_method/option_sanitizers/class_checker_spec.rb
|
584
|
+
- spec/services/mount_method/option_sanitizers/hash_checker_spec.rb
|
585
|
+
- spec/services/mount_method/option_sanitizers/string_checker_spec.rb
|
578
586
|
- spec/services/mount_method/option_validators/provided_operations_validator_spec.rb
|
579
587
|
- spec/services/mount_method/option_validators/skip_only_validator_spec.rb
|
580
|
-
- spec/services/mount_method/
|
588
|
+
- spec/services/mount_method/option_validators/supported_operations_validator_spec.rb
|
589
|
+
- spec/services/mount_method/options_validator_spec.rb
|
590
|
+
- spec/services/resource_loader_spec.rb
|
591
|
+
- spec/services/schema_plugin_spec.rb
|
592
|
+
- spec/spec_helper.rb
|
593
|
+
- spec/support/contexts/graphql_request.rb
|
594
|
+
- spec/support/factory_bot.rb
|
595
|
+
- spec/support/matchers/auth_headers_matcher.rb
|
596
|
+
- spec/support/matchers/not_change_matcher.rb
|
597
|
+
- spec/support/requests/auth_helpers.rb
|
598
|
+
- spec/support/requests/json_helpers.rb
|