graphql-functions 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/lib/graphql/functions/array.rb +6 -0
- data/lib/graphql/functions/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d70a9a955e8b947021e63139526424d70d3a44aa
|
4
|
+
data.tar.gz: 037b83d3f47e3f3438f598064471dd5d0d452f44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0acd5f944532299b05d22786bf1df63b832110d136785e31131b6e51f1003f9b3704fbc242e5a764b2592b21259e3f48ab0be8772b61e509b78716aed926d879
|
7
|
+
data.tar.gz: c59f284286fd46a40e06d0f28b8fd624ef87e23b616d89e614da3d4049933c36278b4964f5310da0140387d68e2626d89eab05bd8adca003131d3239b2f83cb9
|
data/README.md
CHANGED
@@ -89,9 +89,9 @@ module Functions
|
|
89
89
|
argument :country_code, types.String
|
90
90
|
|
91
91
|
def call(obj, args, ctx)
|
92
|
-
query
|
93
|
-
|
94
|
-
|
92
|
+
query(obj, args, ctx) do |relation|
|
93
|
+
relation.where(country_code: args[:countryCode]) if args[:countryCode]
|
94
|
+
end
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
@@ -121,7 +121,7 @@ end
|
|
121
121
|
|
122
122
|
Above changes will in addition to the base query capabilities from `graphql-functions` allow the query to filter by `countryCode` in the `people` field like:
|
123
123
|
|
124
|
-
```
|
124
|
+
```graphql
|
125
125
|
{
|
126
126
|
people(countryCode: 'us', limit: 2, offset: 5) {
|
127
127
|
id,
|
@@ -135,13 +135,13 @@ Above changes will in addition to the base query capabilities from `graphql-func
|
|
135
135
|
|
136
136
|
### Element
|
137
137
|
Element function is intended to be used with a query with a single field output like `person` in the example: The only available argument is id:
|
138
|
-
- `id: Int
|
138
|
+
- `id: Int` Filter by the specified id.
|
139
139
|
|
140
140
|
### Array
|
141
141
|
Array function add filters-like arguments to the query:
|
142
|
-
- `offset: Int`
|
143
|
-
- `limit: Int`
|
144
|
-
-
|
142
|
+
- `offset: Int` Skip the specified argument of records.
|
143
|
+
- `limit: Int` Do not return more rows than the argument.
|
144
|
+
- `ids: [Int]` Filter by the specified ids.
|
145
145
|
|
146
146
|
|
147
147
|
## Development
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-functions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joaquín Moreira
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-06-
|
12
|
+
date: 2017-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.6.
|
160
|
+
rubygems_version: 2.6.12
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Collection of GraphQL functions to give basic active record like support
|