Skip to content

Commit a77ff1c

Browse files
committed
Add skip and only option instructions to README
1 parent a780a06 commit a77ff1c

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,16 @@ First, you need to mount the gem in the routes file like this
4141
Rails.application.routes.draw do
4242
mount_graphql_devise_for 'User', at: 'api/v1', authenticable_type: Types::CustomUserType, operations: {
4343
login: Mutations::Login
44-
}
44+
}, skip: [:sign_up]
45+
end
4546
```
4647
If you used DTA's installer you will have to remove the `mount_devise_token_auth_for`
4748
line.
4849

4950
Here are the option for the mount method:
5051

5152
1. `at`: Route where the GraphQL schema will be mounted on the Rails server. In the
52-
example your API will have this two routes `POST /api/v1//graphql_auth` `GET /api/v1//graphql_auth`.
53+
example your API will have this two routes `POST /api/v1/graphql_auth` and `GET /api/v1/graphql_auth`.
5354
If no this option is not specified, the schema will be mounted at `/graphql_auth`.
5455
1. `operations`: Specifying this one is optional. Here you can override default
5556
behavior by specifying your own mutations and queries for every GraphQL operation.
@@ -62,6 +63,23 @@ our default classes and yielding your customized code after calling `super`, exa
6263
and an `authenticable` type to every query. Gem will try to use `Types::<model>Type` by
6364
default, so in our example you could define `Types::UserType` and every query and mutation
6465
will use it. But, you can override this type with this option like in the example.
66+
1. `skip`: An array of the operations that should not be available in the authentication schema. All these operations are
67+
symbols and should belong to the list of available operations in the gem.
68+
1. `only`: An array of the operations that should be available in the authentication schema. The `skip` and `only` options are
69+
mutually exclusive, an error will be raised if you pass both to the mount method.
70+
71+
#### Available Operations
72+
The following is a list of the symbols you can provide to the `operations`, `skip` and `only` options of the mount method:
73+
```ruby
74+
:login
75+
:logout
76+
:sign_up
77+
:update_password
78+
:send_reset_password
79+
:confirm_account
80+
:check_password_token
81+
```
82+
6583

6684
### Configuring Model
6785
Just like with Devise and DTA, you need to include a module in your authenticable model,

0 commit comments

Comments
 (0)