graphql_devise 0.11.4 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/CHANGELOG.md +8 -0
  4. data/README.md +187 -20
  5. data/app/controllers/graphql_devise/application_controller.rb +4 -5
  6. data/app/controllers/graphql_devise/concerns/set_user_by_token.rb +23 -0
  7. data/app/controllers/graphql_devise/graphql_controller.rb +2 -0
  8. data/app/helpers/graphql_devise/mailer_helper.rb +2 -2
  9. data/config/routes.rb +2 -0
  10. data/graphql_devise.gemspec +3 -3
  11. data/lib/generators/graphql_devise/install_generator.rb +28 -5
  12. data/lib/graphql_devise.rb +16 -4
  13. data/lib/graphql_devise/mount_method/operation_preparer.rb +2 -2
  14. data/lib/graphql_devise/mount_method/operation_preparers/resource_name_setter.rb +1 -1
  15. data/lib/graphql_devise/mutations/sign_up.rb +1 -5
  16. data/lib/graphql_devise/rails/routes.rb +5 -72
  17. data/lib/graphql_devise/resource_loader.rb +87 -0
  18. data/lib/graphql_devise/schema_plugin.rb +87 -0
  19. data/lib/graphql_devise/version.rb +1 -1
  20. data/spec/dummy/app/controllers/api/v1/graphql_controller.rb +6 -2
  21. data/spec/dummy/app/graphql/dummy_schema.rb +9 -0
  22. data/spec/dummy/app/graphql/interpreter_schema.rb +9 -0
  23. data/spec/dummy/app/graphql/types/mutation_type.rb +1 -1
  24. data/spec/dummy/app/graphql/types/query_type.rb +10 -0
  25. data/spec/dummy/config/routes.rb +1 -0
  26. data/spec/generators/graphql_devise/install_generator_spec.rb +21 -0
  27. data/spec/rails_helper.rb +0 -1
  28. data/spec/requests/graphql_controller_spec.rb +80 -0
  29. data/spec/requests/user_controller_spec.rb +180 -24
  30. data/spec/services/mount_method/operation_preparer_spec.rb +2 -2
  31. data/spec/services/mount_method/operation_preparers/custom_operation_preparer_spec.rb +1 -1
  32. data/spec/services/mount_method/operation_preparers/default_operation_preparer_spec.rb +1 -1
  33. data/spec/services/mount_method/operation_preparers/resource_name_setter_spec.rb +1 -1
  34. data/spec/services/resource_loader_spec.rb +82 -0
  35. data/spec/services/schema_plugin_spec.rb +26 -0
  36. metadata +31 -5
  37. data/spec/support/generators/file_helpers.rb +0 -12
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.11.4
4
+ version: 0.12.0
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-05-23 00:00:00.000000000 Z
12
+ date: 2020-06-12 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
@@ -323,7 +341,9 @@ files:
323
341
  - lib/graphql_devise/resolvers/check_password_token.rb
324
342
  - lib/graphql_devise/resolvers/confirm_account.rb
325
343
  - lib/graphql_devise/resolvers/dummy.rb
344
+ - lib/graphql_devise/resource_loader.rb
326
345
  - lib/graphql_devise/schema.rb
346
+ - lib/graphql_devise/schema_plugin.rb
327
347
  - lib/graphql_devise/types/authenticatable_type.rb
328
348
  - lib/graphql_devise/types/credential_type.rb
329
349
  - lib/graphql_devise/types/mutation_type.rb
@@ -336,6 +356,7 @@ files:
336
356
  - spec/dummy/app/controllers/api/v1/graphql_controller.rb
337
357
  - spec/dummy/app/controllers/application_controller.rb
338
358
  - spec/dummy/app/graphql/dummy_schema.rb
359
+ - spec/dummy/app/graphql/interpreter_schema.rb
339
360
  - spec/dummy/app/graphql/mutations/login.rb
340
361
  - spec/dummy/app/graphql/mutations/register_confirmed_user.rb
341
362
  - spec/dummy/app/graphql/mutations/sign_up.rb
@@ -404,6 +425,7 @@ files:
404
425
  - spec/graphql_devise_spec.rb
405
426
  - spec/models/user_spec.rb
406
427
  - spec/rails_helper.rb
428
+ - spec/requests/graphql_controller_spec.rb
407
429
  - spec/requests/mutations/additional_mutations_spec.rb
408
430
  - spec/requests/mutations/additional_queries_spec.rb
409
431
  - spec/requests/mutations/login_spec.rb
@@ -432,10 +454,11 @@ files:
432
454
  - spec/services/mount_method/option_validators/skip_only_validator_spec.rb
433
455
  - spec/services/mount_method/option_validators/supported_operations_validator_spec.rb
434
456
  - spec/services/mount_method/options_validator_spec.rb
457
+ - spec/services/resource_loader_spec.rb
458
+ - spec/services/schema_plugin_spec.rb
435
459
  - spec/spec_helper.rb
436
460
  - spec/support/contexts/graphql_request.rb
437
461
  - spec/support/factory_bot.rb
438
- - spec/support/generators/file_helpers.rb
439
462
  - spec/support/matchers/auth_headers_matcher.rb
440
463
  - spec/support/matchers/not_change_matcher.rb
441
464
  - spec/support/requests/auth_helpers.rb
@@ -461,7 +484,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
461
484
  - !ruby/object:Gem::Version
462
485
  version: '0'
463
486
  requirements: []
464
- rubygems_version: 3.0.6
487
+ rubygems_version: 3.1.4
465
488
  signing_key:
466
489
  specification_version: 4
467
490
  summary: GraphQL queries and mutations on top of devise_token_auth
@@ -474,6 +497,7 @@ test_files:
474
497
  - spec/dummy/app/models/users.rb
475
498
  - spec/dummy/app/models/application_record.rb
476
499
  - spec/dummy/app/models/user.rb
500
+ - spec/dummy/app/graphql/interpreter_schema.rb
477
501
  - spec/dummy/app/graphql/types/custom_admin_type.rb
478
502
  - spec/dummy/app/graphql/types/mutation_type.rb
479
503
  - spec/dummy/app/graphql/types/query_type.rb
@@ -535,6 +559,7 @@ test_files:
535
559
  - spec/dummy/log/development.log
536
560
  - spec/graphql_devise_spec.rb
537
561
  - spec/models/user_spec.rb
562
+ - spec/requests/graphql_controller_spec.rb
538
563
  - spec/requests/user_controller_spec.rb
539
564
  - spec/requests/mutations/login_spec.rb
540
565
  - spec/requests/mutations/logout_spec.rb
@@ -550,7 +575,6 @@ test_files:
550
575
  - spec/support/contexts/graphql_request.rb
551
576
  - spec/support/requests/auth_helpers.rb
552
577
  - spec/support/requests/json_helpers.rb
553
- - spec/support/generators/file_helpers.rb
554
578
  - spec/support/matchers/not_change_matcher.rb
555
579
  - spec/support/matchers/auth_headers_matcher.rb
556
580
  - spec/factories/admins.rb
@@ -559,6 +583,7 @@ test_files:
559
583
  - spec/factories/users_customers.rb
560
584
  - spec/generators/graphql_devise/install_generator_spec.rb
561
585
  - spec/rails_helper.rb
586
+ - spec/services/schema_plugin_spec.rb
562
587
  - spec/services/mount_method/option_sanitizers/class_checker_spec.rb
563
588
  - spec/services/mount_method/option_sanitizers/array_checker_spec.rb
564
589
  - spec/services/mount_method/option_sanitizers/hash_checker_spec.rb
@@ -576,3 +601,4 @@ test_files:
576
601
  - spec/services/mount_method/option_validators/provided_operations_validator_spec.rb
577
602
  - spec/services/mount_method/option_validators/skip_only_validator_spec.rb
578
603
  - spec/services/mount_method/operation_sanitizer_spec.rb
604
+ - spec/services/resource_loader_spec.rb
@@ -1,12 +0,0 @@
1
- require 'fileutils'
2
-
3
- module Generators
4
- module FileHelpers
5
- def create_file_with_content(path, content)
6
- FileUtils.mkdir(File.dirname(path))
7
- File.open(path, 'w') do |f|
8
- f.write(content)
9
- end
10
- end
11
- end
12
- end