skylight-core 4.2.3 → 4.3.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b967f11a876f41f4337a88fce73301993cf3160f862186b64a7d03a931b5ccb6
|
4
|
+
data.tar.gz: b33c7c1ecbfab7545ea7efdbb691371bc35a0f90ef786c8fb8a60e3db9f7a8a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0285603cf5bdd82f8cfa8c9e0f3c54569b8e46051ccd16926e14498e024e5b92c9432b150422285625eee6b359aa46c036e483bda9a0cd7cf1dfd94edcc0d530'
|
7
|
+
data.tar.gz: 27fdc7636b44ddaece0b205e425a6546b5ef39ad0671a1719983b8133825940bded7c711abf5631eab83326c79fbd20adb0925c41aa934155670487cc5c4bb7a
|
@@ -25,7 +25,8 @@ module Skylight::Core
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def get_namespace(endpoint)
|
28
|
-
|
28
|
+
# slice off preceding slash for data continuity
|
29
|
+
::Grape::Namespace.joined_space_path(endpoint.namespace_stackable(:namespace)).to_s[1..-1]
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "active_support/inflector"
|
4
|
+
|
3
5
|
module Skylight::Core::Normalizers::GraphQL
|
4
6
|
# Some AS::N events in GraphQL are not super useful.
|
5
7
|
# We are purposefully ignoring the following keys (and you probably shouldn't add them):
|
@@ -22,7 +24,12 @@ module Skylight::Core::Normalizers::GraphQL
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def self.inherited(klass)
|
25
|
-
klass.const_set(
|
27
|
+
klass.const_set(
|
28
|
+
:KEY,
|
29
|
+
ActiveSupport::Inflector.underscore(
|
30
|
+
ActiveSupport::Inflector.demodulize(klass.name)
|
31
|
+
).freeze
|
32
|
+
)
|
26
33
|
end
|
27
34
|
|
28
35
|
def self.key
|
@@ -38,6 +45,12 @@ module Skylight::Core::Normalizers::GraphQL
|
|
38
45
|
def key
|
39
46
|
self.class.key
|
40
47
|
end
|
48
|
+
|
49
|
+
def extract_query_name(query)
|
50
|
+
query&.context&.[](:skylight_endpoint) ||
|
51
|
+
query&.operation_name ||
|
52
|
+
ANONYMOUS
|
53
|
+
end
|
41
54
|
end
|
42
55
|
|
43
56
|
class Lex < Base
|
@@ -69,7 +82,7 @@ module Skylight::Core::Normalizers::GraphQL
|
|
69
82
|
# has not been done yet at the point where execute_multiplex starts.
|
70
83
|
# [1] https://graphql.org/learn/serving-over-http/#post-request
|
71
84
|
queries, has_errors = payload[:multiplex].queries.each_with_object([Set.new, Set.new]) do |query, (names, errors)|
|
72
|
-
names << (query
|
85
|
+
names << extract_query_name(query)
|
73
86
|
errors << query.static_errors.any?
|
74
87
|
end
|
75
88
|
|
@@ -90,7 +103,7 @@ module Skylight::Core::Normalizers::GraphQL
|
|
90
103
|
register_graphql
|
91
104
|
|
92
105
|
def normalize(trace, _name, payload)
|
93
|
-
query_name = payload[:query]
|
106
|
+
query_name = extract_query_name(payload[:query])
|
94
107
|
|
95
108
|
if query_name == ANONYMOUS
|
96
109
|
meta = { mute_children: true }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|