graphtown 1.0.0 → 1.0.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/CHANGELOG.md +5 -3
- data/README.md +26 -0
- data/lib/graphtown/query_builder.rb +6 -3
- data/lib/graphtown/version.rb +1 -1
- metadata +2 -3
- data/package.json +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c54e2275afc874fe0761dba661b16b746a9c3716f15eb74ee50d986ac442b04b
|
4
|
+
data.tar.gz: c113a90a48131d55dcf0b4d47ce1f17d6b383c5cbfd1fb765c5171a1ddb01499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16912ef133cdd7ae2ae3bfbef980839b6eb8e17a320eb8df113d6aef9bd3d3cbdab1e69bb73ecf4e20add8053a826a623b29cf955a51bab38de8352aa4620e3b
|
7
|
+
data.tar.gz: a66847460dbd420e44a20f2f4ed98040d4ea72b8b22a86179eb94eff25169f86d0d46463281ee9a22d2730269b48fce64d0d18cf364765636eaff92bfc6c3695
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -10,6 +10,32 @@ Run this command to add this plugin to your site's Gemfile:
|
|
10
10
|
$ bundle add graphtown -g bridgetown_plugins
|
11
11
|
```
|
12
12
|
|
13
|
+
And then add the Graphtown mixin to your site builder superclass:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
# plugins/site_builder.rb
|
17
|
+
|
18
|
+
class SiteBuilder < Bridgetown::Builder
|
19
|
+
include Graphtown::QueryBuilder
|
20
|
+
end
|
21
|
+
```
|
22
|
+
|
23
|
+
You'll need to add your desired GraphQL API endpoint to the site config YAML:
|
24
|
+
|
25
|
+
```yaml
|
26
|
+
# bridgetown.config.yml
|
27
|
+
|
28
|
+
graphql_endpoint: http://localhost:1337/graphql
|
29
|
+
```
|
30
|
+
|
31
|
+
Alternatively, you can override the `graphql_endpoint` method in your site builder or a specific builder plugin:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
def graphql_endpoint
|
35
|
+
"https://some.other.domain/graphql"
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
13
39
|
---
|
14
40
|
|
15
41
|
# Documentation coming soon…
|
@@ -31,7 +31,12 @@ module Graphtown
|
|
31
31
|
|
32
32
|
self.class.graphql_queries.send(
|
33
33
|
"#{graph_name}=",
|
34
|
-
client.execute(graph_dsl.to_s, query_variables).data.
|
34
|
+
client.execute(graph_dsl.to_s, query_variables).data.yield_self do |data|
|
35
|
+
# avoid having to do query.foo.foo if possible
|
36
|
+
data.send(graph_name)
|
37
|
+
rescue NoMethodError
|
38
|
+
data
|
39
|
+
end
|
35
40
|
)
|
36
41
|
end
|
37
42
|
|
@@ -40,8 +45,6 @@ module Graphtown
|
|
40
45
|
end
|
41
46
|
|
42
47
|
def graphql_client
|
43
|
-
raise "Please add graphql_endpoint to your config file" unless config[:graphql_endpoint]
|
44
|
-
|
45
48
|
Graphlient::Client.new(graphql_endpoint) do |client|
|
46
49
|
configure_graphql_client(client)
|
47
50
|
end
|
data/lib/graphtown/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphtown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared White
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bridgetown
|
@@ -146,7 +146,6 @@ files:
|
|
146
146
|
- lib/graphtown.rb
|
147
147
|
- lib/graphtown/query_builder.rb
|
148
148
|
- lib/graphtown/version.rb
|
149
|
-
- package.json
|
150
149
|
homepage: https://github.com/whitefusionhq/graphtown
|
151
150
|
licenses:
|
152
151
|
- MIT
|
data/package.json
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "graphtown",
|
3
|
-
"version": "0.1.0",
|
4
|
-
"main": "frontend/javascript/index.js",
|
5
|
-
"repository": {
|
6
|
-
"type": "git",
|
7
|
-
"url": "https://github.com/username/graphtown.git"
|
8
|
-
},
|
9
|
-
"author": "Bridgetown Maintainers <maintainers@bridgetownrb.com>",
|
10
|
-
"homepage": "https://www.bridgetownrb.com",
|
11
|
-
"license": "MIT",
|
12
|
-
"private": false,
|
13
|
-
"files": [
|
14
|
-
"frontend"
|
15
|
-
]
|
16
|
-
}
|