activegraphql 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +19 -2
- data/lib/activegraphql/query.rb +1 -1
- data/lib/activegraphql/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: 7f490b7e893e043ee303228f7d659808aec08f77
|
|
4
|
+
data.tar.gz: 3499be7e33802b8c9889db2a06b04fbbfc635d30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96dfa45e1298a8ada8ce340b74fcde936e663577de144ccaac19ba6e5041d94e579ea6336e831aaa0a44e8b394eb73e32ef01bb8fafe09717e6bc38f636e30cc
|
|
7
|
+
data.tar.gz: 71a8365dcda8afe0907c70aa6f09b0e0f328639619ee243082e69db40a618a1550a40ff3ebe753975c66d40b190ccb072862d069bd3c46c17632c2efde82cd70
|
data/README.md
CHANGED
|
@@ -3,7 +3,24 @@
|
|
|
3
3
|
[](https://travis-ci.org/wakoopa/activegraphql)
|
|
4
4
|
|
|
5
5
|
ActiveGraphQL connects classes to [GraphQL](http://graphql.org/) services.
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your application's Gemfile:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
gem 'activegraphql'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
$ bundle
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## How it works?
|
|
22
|
+
|
|
23
|
+
The library provides an `ActiveGraphQL::Model` class that, when subclassed and configured, encapsulates the communication with the service.
|
|
7
24
|
|
|
8
25
|
```ruby
|
|
9
26
|
class MyModel < ActiveGraphQL::Model
|
|
@@ -11,7 +28,7 @@ class MyModel < ActiveGraphQL::Model
|
|
|
11
28
|
end
|
|
12
29
|
```
|
|
13
30
|
|
|
14
|
-
Any subclass of `ActiveGraphQL::Model`
|
|
31
|
+
Any subclass of `ActiveGraphQL::Model` provides the following methods:
|
|
15
32
|
|
|
16
33
|
- **all:** Retrive all objects for the entity.
|
|
17
34
|
- **where(conditions):** Retrieve all objects for the entity finding by conditions.
|
data/lib/activegraphql/query.rb
CHANGED
|
@@ -19,7 +19,7 @@ module ActiveGraphQL
|
|
|
19
19
|
|
|
20
20
|
def request_options
|
|
21
21
|
{ query: { query: to_s } }.tap do |opts|
|
|
22
|
-
opts.merge!(headers: { '
|
|
22
|
+
opts.merge!(headers: { 'Accept-Language' => locale.to_s }) if locale.present?
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activegraphql
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wakoopa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-04-
|
|
11
|
+
date: 2016-04-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
137
137
|
version: '0'
|
|
138
138
|
requirements: []
|
|
139
139
|
rubyforge_project:
|
|
140
|
-
rubygems_version: 2.5.1
|
|
140
|
+
rubygems_version: 2.4.5.1
|
|
141
141
|
signing_key:
|
|
142
142
|
specification_version: 4
|
|
143
143
|
summary: Ruby client for GraphQL services
|