optics-agent 0.5.3 → 0.5.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 065cdcba6db6b8457fad1490b92d308e28391eef
|
4
|
+
data.tar.gz: d8ab5426156a69f208a48aba2a6c1ca32920d06a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de45eae022f04a626a22b7bda8a38a1889f6e8879e85389b4ef802755adcb45a7a7d0502455720a3ce7a186fbd56d44bb126e9dc9b13475e04f7ebf88a8c5bc7
|
7
|
+
data.tar.gz: 7705bfd5c7b424d86452145acec4a3145d7a86fef118e2765f36e29ebae7c7f6e63a5fe9351f38fc84265206e19e602982c3936186b702e6b39c5cff5705b42c
|
@@ -27,7 +27,7 @@ If you don't want to instrument this query, pass `context: {optics_agent: :skip}
|
|
27
27
|
query_context = query.context[:optics_agent]
|
28
28
|
end
|
29
29
|
|
30
|
-
query_context.with_document(query.
|
30
|
+
query_context.with_document(query.document.to_query_string)
|
31
31
|
end
|
32
32
|
|
33
33
|
def after_query(query)
|
@@ -95,7 +95,7 @@ module OpticsAgent::Reporting
|
|
95
95
|
type = schema.types[type_stat.name]
|
96
96
|
throw "Type #{type_stat.name} not found!" unless type
|
97
97
|
|
98
|
-
field = type.
|
98
|
+
field = type.get_field(field_stat.name)
|
99
99
|
throw "Field #{type_stat.name}.#{field_stat.name} not found!" unless field
|
100
100
|
|
101
101
|
field_stat.returnType = field.type.to_s
|
@@ -31,7 +31,7 @@ module OpticsAgent::Reporting
|
|
31
31
|
type = schema.types[type_name]
|
32
32
|
next unless type.is_a? GraphQL::ObjectType
|
33
33
|
|
34
|
-
fields = type.
|
34
|
+
fields = type.all_fields.map do |field|
|
35
35
|
Field.new({
|
36
36
|
name: field.name,
|
37
37
|
# XXX: does this actually work for all types?
|
data/spec/schema_spec.rb
CHANGED
@@ -5,10 +5,15 @@ include OpticsAgent::Reporting
|
|
5
5
|
|
6
6
|
describe Schema do
|
7
7
|
it "can collect the correct types from a schema" do
|
8
|
+
address_interface = GraphQL::InterfaceType.define do
|
9
|
+
name 'Address'
|
10
|
+
field :streetOne, types.String
|
11
|
+
end
|
8
12
|
person_type = GraphQL::ObjectType.define do
|
9
13
|
name 'Person'
|
10
14
|
field :firstName, types.String
|
11
15
|
field :lastName, types.String
|
16
|
+
interfaces [address_interface]
|
12
17
|
end
|
13
18
|
query_type = GraphQL::ObjectType.define do
|
14
19
|
name 'Query'
|
@@ -17,6 +22,9 @@ describe Schema do
|
|
17
22
|
|
18
23
|
schema = GraphQL::Schema.define do
|
19
24
|
query query_type
|
25
|
+
resolve_type ->(object, context) do
|
26
|
+
# noop
|
27
|
+
end
|
20
28
|
end
|
21
29
|
|
22
30
|
schema_report = Schema.new(schema).message
|
@@ -25,7 +33,7 @@ describe Schema do
|
|
25
33
|
expect(type.map &:name).to match_array(['Person', 'Query'])
|
26
34
|
|
27
35
|
person_type = type.find { |t| t.name == 'Person' }
|
28
|
-
expect(person_type.field.map &:name).to match_array(['firstName', 'lastName'])
|
36
|
+
expect(person_type.field.map &:name).to match_array(['firstName', 'lastName', 'streetOne'])
|
29
37
|
|
30
38
|
firstName_field = person_type.field.find { |f| f.name === 'firstName' }
|
31
39
|
expect(firstName_field.returnType).to eq('String')
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: optics-agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Meteor Development Group
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '3.5'
|
111
111
|
description: An Agent for Apollo Optics, http://optics.apollodata.com
|
112
|
-
email:
|
112
|
+
email: vendor+optics@meteor.com
|
113
113
|
executables: []
|
114
114
|
extensions: []
|
115
115
|
extra_rdoc_files: []
|