You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+70-5Lines changed: 70 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,12 @@
2
2
3
3
A few generators to make it easy to integrate your Rails models with [graphql-ruby](https://github.com/rmosolgo/graphql-ruby). I created this because I was wasting too many keystrokes copying my model schema by hand to create graphql types.
4
4
5
-
This project contains three generators that look at your ActiveRecord model schema and generates graphql types for you.
5
+
This project contains generators that look at your ActiveRecord model schema and generates graphql types for you.
6
6
7
-
*`gql:model_type Post` - Generate a graphql type for a model
8
-
*`gql:input Post` - Generate a graphql input type for a model
9
-
*`gql:mutation Update Post` - Generate a graphql mutation class for a model
7
+
-`gql:model_type Post` - Generate a graphql type for a model
8
+
-`gql:input Post` - Generate a graphql input type for a model
9
+
-`gql:mutation Update Post` - Generate a graphql mutation class for a model
10
+
-`gql:search_object` - A search object based on [SearchObjectGraphQL](https://github.com/RStankov/SearchObjectGraphQL)
10
11
11
12
## Installation
12
13
@@ -52,6 +53,7 @@ rails generate gql:input Post
52
53
```
53
54
54
55
Result:
56
+
55
57
```ruby
56
58
# app/graphql/types/post_input.rb
57
59
moduleTypes
@@ -77,6 +79,7 @@ rails generate gql:mutation Update Post
77
79
```
78
80
79
81
Result:
82
+
80
83
```ruby
81
84
# app/graphql/mutations/update_post.rb
82
85
moduleMutations
@@ -105,4 +108,66 @@ module Mutations
105
108
end
106
109
end
107
110
end
108
-
```
111
+
```
112
+
113
+
### gql:search_object MODEL_NAME
114
+
115
+
Generate a search object from a model using [SearchObjectGraphQL](https://github.com/RStankov/SearchObjectGraphQL)
116
+
117
+
If you have not yet created a base search resolver:
0 commit comments