Skip to content

Commit

Permalink
Merge pull request #250 from graphql-devise/bump-to-v-1.2.0
Browse files Browse the repository at this point in the history
Bump to v 1.2.0
  • Loading branch information
mcelicalderon committed Nov 21, 2022
2 parents b4b8721 + 505cc09 commit 281d5a2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Expand Up @@ -20,13 +20,13 @@ jobs:
- checkout
- restore_cache:
keys:
- v2.0-<< parameters.gemfile >>-<< parameters.ruby-version >>
- v2.3-<< parameters.gemfile >>-<< parameters.ruby-version >>
- run: gem install bundler -v '1.17'
- run:
name: Install dependencies
command: bundle install
- save_cache:
key: v2.0-<< parameters.gemfile >>-<< parameters.ruby-version >>
key: v2.3-<< parameters.gemfile >>-<< parameters.ruby-version >>
paths:
- vendor/bundle
- run:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -4,7 +4,7 @@ require:
- rubocop-rails

AllCops:
TargetRubyVersion: 2.3
TargetRubyVersion: 2.4.4
DisplayCopNames: true
Exclude:
- bin/**/*
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog

## [v1.2.0](https://github.com/graphql-devise/graphql_devise/tree/v1.2.0) (2022-11-14)

[Full Changelog](https://github.com/graphql-devise/graphql_devise/compare/v1.1.1...v1.2.0)

**Implemented enhancements:**

- Set base controller from route mount [\#237](https://github.com/graphql-devise/graphql_devise/pull/237) ([00dav00](https://github.com/00dav00))

## [v1.1.1](https://github.com/graphql-devise/graphql_devise/tree/v1.1.1) (2022-10-20)

[Full Changelog](https://github.com/graphql-devise/graphql_devise/compare/v1.1.0...v1.1.1)
Expand Down
9 changes: 7 additions & 2 deletions README.md
Expand Up @@ -157,7 +157,8 @@ Rails.application.routes.draw do
login: Mutations::Login
},
skip: [:register],
# base_controller: ApiController,
# optional, use only if you need a specific base controller to mount the new actions
base_controller: ApiController,
additional_mutations: {
# generates mutation { adminUserSignUp }
admin_user_sign_up: Mutations::AdminUserSignUp
Expand Down Expand Up @@ -265,7 +266,11 @@ our default classes and yielding your customized code after calling `super`, exa
and an `authenticatable` type to every query. Gem will try to use `Types::<model>Type` by
default, so in our example you could define `Types::UserType` and every query and mutation
will use it. But, you can override this type with this option like in the example.
1. `base_controller`: Specifying this is optional. By default the controller used to mount the route is `GraphqlDevise::ApplicationController` which inherits from `ActionController::API` or `ActionController::Base` depending on the rails version of the main project. This option allows you to set the controller used as the parent of the controller where the route will be mounted. This config is similar to `Devise`'s `base_controller` config but in this case each route can have a different parent controller.
1. `base_controller`: Specifying this is optional. By default the controller used to mount the route is
`GraphqlDevise::ApplicationController` which inherits from `ActionController::API` or `ActionController::Base`
depending on the rails version of the main project. This option allows you to set the controller used as the parent of
the controller where the route will be mounted. This config is similar to `Devise`'s `base_controller` config but in
this case each route can have a different parent controller. **This option only works if you are using the mount method.**
1. `skip`: An array of the operations that should not be available in the authentication schema. All these operations are
symbols and should belong to the list of available operations in the gem.
1. `only`: An array of the operations that should be available in the authentication schema. The `skip` and `only` options are
Expand Down
2 changes: 1 addition & 1 deletion lib/graphql_devise/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module GraphqlDevise
VERSION = '1.1.1'
VERSION = '1.2.0'
end
21 changes: 10 additions & 11 deletions spec/requests/mutations/login_spec.rb
Expand Up @@ -185,23 +185,22 @@
end
end


if DeviseTokenAuth.respond_to?(:cookie_enabled)
context 'when using cookies for auth' do
let!(:user) { create(:user, :confirmed, password: password, email: 'vvega@wallaceinc.com') }
let(:email) { user.email }
let(:query) do
<<-GRAPHQL
mutation {
userLogin(
email: "#{email}",
password: "#{password}"
) {
authenticatable { email }
credentials { accessToken uid tokenType client expiry }
mutation {
userLogin(
email: "#{email}",
password: "#{password}"
) {
authenticatable { email }
credentials { accessToken uid tokenType client expiry }
}
}
}
GRAPHQL
GRAPHQL
end

around do |example|
Expand All @@ -214,7 +213,7 @@

it 'honors DTA configuration of setting auth info in cookies' do
cookie = cookies.get_cookie('auth_cookie')
expect(JSON.parse(cookie.value).keys).to include(*%w[uid access-token client])
expect(JSON.parse(cookie.value).keys).to include('uid', 'access-token', 'client')
end
end
end
Expand Down

0 comments on commit 281d5a2

Please sign in to comment.