gql 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gql/config.rb +11 -4
- data/lib/gql/has_fields.rb +0 -4
- data/lib/gql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91c3e88c06f95f36b8f36526bce27d09799bec99
|
4
|
+
data.tar.gz: fc749a590e76c66395a5f7d9bc8353368004053a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 322528bd170fde6ab9d4ccfb70f4faa1619c4da64b9189b49f11899dc2a265db48ea08d6e95512e234d275845d13c733e70300ee7b039f434f8b1a956ab18e24
|
7
|
+
data.tar.gz: b38aea1027e426fe732024b35ed37bf23bf41feb3cd31b63e62730f1f53be942452097d526a6569bd7b5c832b416bc1258363fe6f2bd40a7b684e42ccff9e078
|
data/lib/gql/config.rb
CHANGED
@@ -66,13 +66,18 @@ module GQL
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def debug
|
69
|
-
@@debug
|
69
|
+
if defined? @@debug
|
70
|
+
@@debug
|
71
|
+
else
|
72
|
+
@@debug = nil
|
73
|
+
self.debug = ENV.has_key?('DEBUG')
|
74
|
+
end
|
70
75
|
end
|
71
76
|
|
72
77
|
def debug=(value)
|
73
78
|
value = !!value
|
74
79
|
|
75
|
-
return if value == debug
|
80
|
+
return if value == @@debug
|
76
81
|
|
77
82
|
value ? switch_debug_on : switch_debug_off
|
78
83
|
|
@@ -93,8 +98,10 @@ module GQL
|
|
93
98
|
def switch_on_type_field
|
94
99
|
return if Node.fields.has_key? :__type__
|
95
100
|
|
96
|
-
|
97
|
-
|
101
|
+
type_field_class = Node.object :__type__, -> { field_class }, node_class: Schema::Field
|
102
|
+
|
103
|
+
Node.descendants.each do |node_class|
|
104
|
+
node_class.fields[:__type__] = type_field_class
|
98
105
|
end
|
99
106
|
end
|
100
107
|
|
data/lib/gql/has_fields.rb
CHANGED
@@ -10,10 +10,6 @@ module GQL
|
|
10
10
|
included do
|
11
11
|
class_attribute :fields, :field_proc, instance_accessor: false, instance_predicate: false
|
12
12
|
self.fields = {}
|
13
|
-
|
14
|
-
object :__type__, -> { field_class }, node_class: Schema::Field if GQL.debug
|
15
|
-
|
16
|
-
const_set :ExecutionContext, GQL.debug ? ExecutionContextDebug : ExecutionContextNoDebug
|
17
13
|
end
|
18
14
|
|
19
15
|
module ClassMethods
|
data/lib/gql/version.rb
CHANGED