graphql_devise 0.11.1 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.rspec +1 -0
  4. data/.travis.yml +11 -3
  5. data/CHANGELOG.md +43 -0
  6. data/README.md +191 -32
  7. data/app/controllers/graphql_devise/application_controller.rb +4 -1
  8. data/app/controllers/graphql_devise/concerns/set_user_by_token.rb +23 -0
  9. data/app/controllers/graphql_devise/graphql_controller.rb +2 -0
  10. data/app/helpers/graphql_devise/mailer_helper.rb +2 -2
  11. data/config/locales/en.yml +1 -0
  12. data/config/routes.rb +14 -7
  13. data/graphql_devise.gemspec +6 -4
  14. data/lib/generators/graphql_devise/install_generator.rb +63 -30
  15. data/lib/graphql_devise.rb +39 -6
  16. data/lib/graphql_devise/default_operations/mutations.rb +6 -6
  17. data/lib/graphql_devise/default_operations/resolvers.rb +2 -2
  18. data/lib/graphql_devise/errors/authentication_error.rb +7 -0
  19. data/lib/graphql_devise/{detailed_user_error.rb → errors/detailed_user_error.rb} +1 -1
  20. data/lib/graphql_devise/errors/error_codes.rb +6 -0
  21. data/lib/graphql_devise/errors/execution_error.rb +4 -0
  22. data/lib/graphql_devise/{user_error.rb → errors/user_error.rb} +1 -1
  23. data/lib/graphql_devise/mount_method/operation_preparer.rb +2 -2
  24. data/lib/graphql_devise/mount_method/operation_preparers/default_operation_preparer.rb +6 -2
  25. data/lib/graphql_devise/mount_method/operation_preparers/gql_name_setter.rb +1 -1
  26. data/lib/graphql_devise/mount_method/operation_preparers/mutation_field_setter.rb +3 -2
  27. data/lib/graphql_devise/mount_method/operation_preparers/resolver_type_setter.rb +1 -1
  28. data/lib/graphql_devise/mount_method/operation_preparers/resource_name_setter.rb +2 -2
  29. data/lib/graphql_devise/mutations/resend_confirmation.rb +1 -4
  30. data/lib/graphql_devise/mutations/send_password_reset.rb +3 -1
  31. data/lib/graphql_devise/mutations/sign_up.rb +1 -5
  32. data/lib/graphql_devise/rails/routes.rb +5 -67
  33. data/lib/graphql_devise/resource_loader.rb +87 -0
  34. data/lib/graphql_devise/schema_plugin.rb +87 -0
  35. data/lib/graphql_devise/version.rb +1 -1
  36. data/spec/dummy/app/controllers/api/v1/graphql_controller.rb +11 -2
  37. data/spec/dummy/app/controllers/application_controller.rb +1 -0
  38. data/spec/dummy/app/graphql/dummy_schema.rb +9 -0
  39. data/spec/dummy/app/graphql/interpreter_schema.rb +9 -0
  40. data/spec/dummy/app/graphql/types/mutation_type.rb +1 -1
  41. data/spec/dummy/app/graphql/types/query_type.rb +10 -0
  42. data/spec/dummy/config/environments/test.rb +1 -1
  43. data/spec/dummy/config/routes.rb +1 -0
  44. data/spec/generators/graphql_devise/install_generator_spec.rb +62 -30
  45. data/spec/rails_helper.rb +4 -1
  46. data/spec/requests/graphql_controller_spec.rb +80 -0
  47. data/spec/requests/mutations/resend_confirmation_spec.rb +2 -14
  48. data/spec/requests/mutations/send_password_reset_spec.rb +8 -3
  49. data/spec/requests/user_controller_spec.rb +180 -24
  50. data/spec/services/mount_method/operation_preparer_spec.rb +8 -3
  51. data/spec/services/mount_method/operation_preparers/custom_operation_preparer_spec.rb +1 -1
  52. data/spec/services/mount_method/operation_preparers/default_operation_preparer_spec.rb +15 -8
  53. data/spec/services/mount_method/operation_preparers/mutation_field_setter_spec.rb +18 -4
  54. data/spec/services/mount_method/operation_preparers/resource_name_setter_spec.rb +1 -1
  55. data/spec/services/resource_loader_spec.rb +82 -0
  56. data/spec/services/schema_plugin_spec.rb +26 -0
  57. data/spec/spec_helper.rb +1 -1
  58. metadata +107 -89
  59. data/lib/graphql_devise/error_codes.rb +0 -5
  60. data/spec/support/generators/file_helpers.rb +0 -12
@@ -1,5 +0,0 @@
1
- module GraphqlDevise
2
- ERROR_CODES = {
3
- user_error: 'USER_ERROR'
4
- }.freeze
5
- end
@@ -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