Skip to content

Commit fc6b0d5

Browse files
aaronamcelicalderon
authored andcommitted
Grammar fixes in README.md documentation. (#23)
* A view grammar fixes for the current documentation. * Update README.md A quick edit before sending a pull request. * Post code review changes to documentation.
1 parent e04b5d2 commit fc6b0d5

1 file changed

Lines changed: 20 additions & 15 deletions

File tree

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
[![Build Status](https://travis-ci.org/graphql-devise/graphql_devise.svg?branch=master)](https://travis-ci.org/graphql-devise/graphql_devise)
33
[![Gem Version](https://badge.fury.io/rb/graphql_devise.svg)](https://badge.fury.io/rb/graphql_devise)
44

5+
GraphQL interface on top of the [Devise Token Auth](https://github.com/lynndylanhurley/devise_token_auth) (DTA) gem.
6+
57
## Installation
68

79
Add this line to your application's Gemfile:
@@ -18,8 +20,6 @@ Or install it yourself as:
1820

1921
$ gem install graphql_devise
2022

21-
GraphQL interface on top of the [Devise Token Auth](https://github.com/lynndylanhurley/devise_token_auth) (DTA) gem.
22-
2323
## Usage
2424
All configurations for [Devise](https://github.com/plataformatec/devise) and
2525
[Devise Token Auth](https://github.com/lynndylanhurley/devise_token_auth) are
@@ -39,24 +39,29 @@ First, you need to mount the gem in the routes file like this
3939
# config/routes.rb
4040

4141
Rails.application.routes.draw do
42-
mount_graphql_devise_for 'User', at: 'api/v1', authenticable_type: Types::CustomUserType, operations: {
43-
login: Mutations::Login
44-
}, skip: [:sign_up]
42+
mount_graphql_devise_for(
43+
'User',
44+
at: 'api/v1',
45+
authenticable_type: Types::MyCustomUserType,
46+
operations: {
47+
login: Mutations::Login
48+
},
49+
skip: [:sign_up]
50+
)
4551
end
4652
```
4753
If you used DTA's installer you will have to remove the `mount_devise_token_auth_for`
4854
line.
4955

50-
Here are the option for the mount method:
56+
Here are the options for the mount method:
5157

52-
1. `at`: Route where the GraphQL schema will be mounted on the Rails server. In the
53-
example your API will have this two routes `POST /api/v1/graphql_auth` and `GET /api/v1/graphql_auth`.
54-
If no this option is not specified, the schema will be mounted at `/graphql_auth`.
55-
1. `operations`: Specifying this one is optional. Here you can override default
58+
1. `at`: Route where the GraphQL schema will be mounted on the Rails server. In this example your API will have these two routes: `POST /api/v1/graphql_auth` and `GET /api/v1/graphql_auth`.
59+
If this option is not specified, the schema will be mounted at `/graphql_auth`.
60+
1. `operations`: Specifying this is optional. Here you can override default
5661
behavior by specifying your own mutations and queries for every GraphQL operation.
5762
Check available operations in this file [mutations](https://github.com/graphql-devise/graphql_devise/blob/b5985036e01ea064e43e457b4f0c8516f172471c/lib/graphql_devise/rails/routes.rb#L19)
5863
and [queries](https://github.com/graphql-devise/graphql_devise/blob/b5985036e01ea064e43e457b4f0c8516f172471c/lib/graphql_devise/rails/routes.rb#L41).
59-
All mutations and queries are build so you can extend default behavior just by extending
64+
All mutations and queries are built so you can extend default behavior just by extending
6065
our default classes and yielding your customized code after calling `super`, example
6166
[here](https://github.com/graphql-devise/graphql_devise/blob/b5985036e01ea064e43e457b4f0c8516f172471c/spec/dummy/app/graphql/mutations/login.rb#L6).
6267
1. `authenticable_type`: By default, the gem will add an `authenticable` field to every mutation
@@ -82,8 +87,8 @@ The following is a list of the symbols you can provide to the `operations`, `ski
8287

8388

8489
### Configuring Model
85-
Just like with Devise and DTA, you need to include a module in your authenticable model,
86-
so as for our example, your user model will have to look like this:
90+
Just like with Devise and DTA, you need to include a module in your authenticatable model,
91+
so with our example, your user model will have to look like this:
8792
```ruby
8893
# app/models/user.rb
8994

@@ -109,7 +114,7 @@ so if you want to change them, place yours on the same dir structure on your Rai
109114
1. `app/views/graphql_devise/mailer/reset_password_instructions.html.erb`
110115

111116
The main reason for this difference is just to make it easier to have both Standard `Devise` and this gem running at the same time.
112-
Check [these files](app/views/graphql_devise/mailer) to see the available helper methods you can use in the views.
117+
Check [these files](app/views/graphql_devise/mailer) to see the available helper methods you can use in your views.
113118

114119
### Authenticating Controller Actions
115120
Just like with Devise or DTA, you will need to authenticate users in your controllers.
@@ -147,7 +152,7 @@ the confirmation and reset password email urls. There is no limitation for makin
147152
requests using the `GET` method on the Rails side, but looks like there might be a limitation
148153
on the [Apollo Client](https://www.apollographql.com/docs/apollo-server/v1/requests/#get-requests).
149154

150-
We will continue to build better docs for the gem after this first release, but on the mean time
155+
We will continue to build better docs for the gem after this first release, but in the mean time
151156
you can use [our specs](https://github.com/graphql-devise/graphql_devise/tree/b5985036e01ea064e43e457b4f0c8516f172471c/spec/requests) to better understand how to use the gem.
152157
Also, the [dummy app](https://github.com/graphql-devise/graphql_devise/tree/b5985036e01ea064e43e457b4f0c8516f172471c/spec/dummy) used in our specs will give you
153158
a clear idea on how to configure the gem on your Rails application.

0 commit comments

Comments
 (0)