graphql 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphql/query.rb +1 -17
- data/lib/graphql/query/context.rb +20 -0
- data/lib/graphql/query/parallel_execution.rb +1 -0
- data/lib/graphql/version.rb +1 -1
- data/readme.md +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c0ce19c395ce2fa16c8bdda05deb21afff1ed50
|
4
|
+
data.tar.gz: 3b0d23d2040af5c80c658540184c73b498e9953e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d19a08cc0c1924b68cffbfc70684fd72c9294eb11a96262efbbd6941c8885aec35a19c5bb2776ffb470b90be6f83dfafb969c275bdde6af25cdf236b7f1faec
|
7
|
+
data.tar.gz: dcc7027ef6dabc7a901e7c0b355df51b3fbbbea5922f987a835dcb0dc85ebdef9c27f9d5a12e4c43279d465feacc4862a58eef9c041c8ebe46c7fcc6a124b116
|
data/lib/graphql/query.rb
CHANGED
@@ -48,23 +48,6 @@ class GraphQL::Query
|
|
48
48
|
def validation_errors
|
49
49
|
@validation_errors ||= @schema.static_validator.validate(@document)
|
50
50
|
end
|
51
|
-
|
52
|
-
# Expose some query-specific info to field resolve functions.
|
53
|
-
# It delegates `[]` to the hash that's passed to `GraphQL::Query#initialize`.
|
54
|
-
class Context
|
55
|
-
attr_accessor :execution_strategy, :ast_node
|
56
|
-
def initialize(values:)
|
57
|
-
@values = values
|
58
|
-
end
|
59
|
-
|
60
|
-
def [](key)
|
61
|
-
@values[key]
|
62
|
-
end
|
63
|
-
|
64
|
-
def async(&block)
|
65
|
-
execution_strategy.async(block)
|
66
|
-
end
|
67
|
-
end
|
68
51
|
end
|
69
52
|
|
70
53
|
require 'graphql/query/arguments'
|
@@ -74,3 +57,4 @@ require 'graphql/query/parallel_execution'
|
|
74
57
|
require 'graphql/query/type_resolver'
|
75
58
|
require 'graphql/query/directive_chain'
|
76
59
|
require 'graphql/query/executor'
|
60
|
+
require 'graphql/query/context'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module GraphQL
|
2
|
+
class Query
|
3
|
+
# Expose some query-specific info to field resolve functions.
|
4
|
+
# It delegates `[]` to the hash that's passed to `GraphQL::Query#initialize`.
|
5
|
+
class Context
|
6
|
+
attr_accessor :execution_strategy, :ast_node
|
7
|
+
def initialize(values:)
|
8
|
+
@values = values
|
9
|
+
end
|
10
|
+
|
11
|
+
def [](key)
|
12
|
+
@values[key]
|
13
|
+
end
|
14
|
+
|
15
|
+
def async(&block)
|
16
|
+
execution_strategy.async(block)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/graphql/version.rb
CHANGED
data/readme.md
CHANGED
@@ -123,6 +123,7 @@ If you're building a backend for [Relay](http://facebook.github.io/relay/), you'
|
|
123
123
|
- `graphql-ruby` + Rails demo ([src](https://github.com/rmosolgo/graphql-ruby-demo) / [heroku](http://graphql-ruby-demo.herokuapp.com))
|
124
124
|
- [GraphQL Slack](https://graphql-slack.herokuapp.com/)
|
125
125
|
- [Example Relay support](https://github.com/rmosolgo/graphql-relay-ruby) in Ruby
|
126
|
+
- [`graphql-parallel`][https://github.com/rmosolgo/graphql-parallel], an asynchronous query execution strategy
|
126
127
|
|
127
128
|
## P.S.
|
128
129
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- lib/graphql/query/base_execution.rb
|
225
225
|
- lib/graphql/query/base_execution/selected_object_resolution.rb
|
226
226
|
- lib/graphql/query/base_execution/value_resolution.rb
|
227
|
+
- lib/graphql/query/context.rb
|
227
228
|
- lib/graphql/query/directive_chain.rb
|
228
229
|
- lib/graphql/query/executor.rb
|
229
230
|
- lib/graphql/query/parallel_execution.rb
|