line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GraphQL::Language::Receiver; |
2
|
|
|
|
|
|
|
|
3
|
21
|
|
|
21
|
|
429
|
use 5.014; |
|
21
|
|
|
|
|
80
|
|
4
|
21
|
|
|
21
|
|
123
|
use strict; |
|
21
|
|
|
|
|
54
|
|
|
21
|
|
|
|
|
496
|
|
5
|
21
|
|
|
21
|
|
125
|
use warnings; |
|
21
|
|
|
|
|
57
|
|
|
21
|
|
|
|
|
625
|
|
6
|
21
|
|
|
21
|
|
119
|
use base 'Pegex::Receiver'; |
|
21
|
|
|
|
|
50
|
|
|
21
|
|
|
|
|
8527
|
|
7
|
21
|
|
|
21
|
|
32313
|
use Types::Standard -all; |
|
21
|
|
|
|
|
67
|
|
|
21
|
|
|
|
|
193
|
|
8
|
21
|
|
|
21
|
|
998962
|
use GraphQL::MaybeTypeCheck; |
|
21
|
|
|
|
|
229
|
|
|
21
|
|
|
|
|
476
|
|
9
|
21
|
|
|
21
|
|
708
|
use JSON::MaybeXS; |
|
21
|
|
|
|
|
4310
|
|
|
263
|
|
|
|
|
3451
|
|
10
|
263
|
|
|
21
|
|
574
|
use Carp; |
|
263
|
|
|
|
|
920
|
|
|
263
|
|
|
|
|
12292
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $JSON = JSON::MaybeXS->new->allow_nonref->canonical; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my @KINDHASH = qw( |
15
|
|
|
|
|
|
|
scalar |
16
|
|
|
|
|
|
|
union |
17
|
|
|
|
|
|
|
field |
18
|
|
|
|
|
|
|
inline_fragment |
19
|
|
|
|
|
|
|
fragment_spread |
20
|
|
|
|
|
|
|
fragment |
21
|
|
|
|
|
|
|
directive |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
my %KINDHASH21 = map { ($_ => 1) } @KINDHASH; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my @KINDFIELDS = qw( |
26
|
|
|
|
|
|
|
type |
27
|
|
|
|
|
|
|
input |
28
|
|
|
|
|
|
|
interface |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
my %KINDFIELDS21 = map { ($_ => 1) } @KINDFIELDS; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
GraphQL::Language::Receiver - GraphQL Pegex AST constructor |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 VERSION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Version 0.02 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# this class used internally by: |
47
|
|
|
|
|
|
|
use GraphQL::Language::Parser qw(parse); |
48
|
|
|
|
|
|
|
my $parsed = parse($source); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Subclass of L<Pegex::Receiver> to turn Pegex parsing events into data |
53
|
|
|
|
|
|
|
usable by GraphQL. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
10492
|
50
|
|
10492
|
1
|
2210931
|
method gotrule (Any $param = undef) { |
|
10492
|
50
|
|
|
|
18740
|
|
|
10492
|
50
|
|
|
|
15164
|
|
|
10492
|
|
|
|
|
16700
|
|
|
10492
|
|
|
|
|
24082
|
|
|
10492
|
|
|
|
|
72106
|
|
58
|
10492
|
100
|
|
|
|
25178
|
return unless defined $param; |
59
|
4399
|
100
|
|
|
|
14212
|
if ($KINDHASH21{$self->{parser}{rule}}) { |
|
|
100
|
|
|
|
|
|
60
|
878
|
|
|
|
|
1908
|
return {kind => $self->{parser}{rule}, %{$self->_locate_hash(_merge_hash($param))}}; |
|
878
|
|
|
|
|
2155
|
|
61
|
|
|
|
|
|
|
} elsif ($KINDFIELDS21{$self->{parser}{rule}}) { |
62
|
107
|
|
|
|
|
231
|
return {kind => $self->{parser}{rule}, %{$self->_locate_hash(_merge_hash($param, 'fields'))}}; |
|
107
|
|
|
|
|
258
|
|
63
|
|
|
|
|
|
|
} |
64
|
3414
|
|
|
|
|
13111
|
return {$self->{parser}{rule} => $param}; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
1321
|
50
|
|
1321
|
|
2862
|
method _locate_hash(HashRef $hash) { |
|
1321
|
50
|
|
|
|
2732
|
|
|
1321
|
50
|
|
|
|
2051
|
|
|
1321
|
|
|
|
|
2155
|
|
|
1321
|
|
|
|
|
3024
|
|
|
1079
|
|
|
|
|
9057
|
|
68
|
1079
|
|
|
|
|
1545
|
my ($line, $column) = @{$self->{parser}->line_column($self->{parser}{farthest})}; |
|
1079
|
|
|
|
|
3949
|
|
69
|
1079
|
|
|
|
|
42899
|
+{ %$hash, location => { line => $line, column => $column } }; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
1625
|
50
|
|
1625
|
|
3824
|
fun _merge_hash (Any $param = undef, Any $arraykey = undef) { |
|
1625
|
50
|
|
|
|
3164
|
|
|
1625
|
50
|
|
|
|
3678
|
|
|
1625
|
|
|
|
|
11635
|
|
|
1625
|
|
|
|
|
9745
|
|
73
|
1625
|
|
|
|
|
11281
|
my %def = map %$_, grep ref eq 'HASH', @$param; |
74
|
1625
|
100
|
|
|
|
4417
|
if ($arraykey) { |
75
|
107
|
|
|
|
|
377
|
my @arrays = grep ref eq 'ARRAY', @$param; |
76
|
107
|
50
|
|
|
|
288
|
Carp::confess "More than one array found\n" if @arrays > 1; |
77
|
107
|
50
|
|
|
|
236
|
Carp::confess "No arrays found but \$arraykey given\n" if !@arrays; |
78
|
107
|
|
|
|
|
169
|
my %fields = map %$_, @{$arrays[0]}; |
|
107
|
|
|
|
|
386
|
|
79
|
107
|
|
|
|
|
338
|
$def{$arraykey} = \%fields; |
80
|
|
|
|
|
|
|
} |
81
|
1625
|
|
|
|
|
5078
|
\%def; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
65
|
50
|
|
65
|
|
209
|
fun _unescape (Str $str) { |
|
65
|
50
|
|
|
|
212
|
|
|
65
|
50
|
|
|
|
177
|
|
|
65
|
|
|
|
|
214
|
|
|
65
|
|
|
|
|
803
|
|
85
|
|
|
|
|
|
|
# https://facebook.github.io/graphql/June2018/#EscapedCharacter |
86
|
65
|
|
|
|
|
217
|
$str =~ s|\\(["\\/bfnrt])|"qq!\\$1!"|gee; |
|
1
|
|
|
|
|
69
|
|
87
|
65
|
|
|
|
|
260
|
return $str; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
14
|
50
|
|
14
|
|
45
|
fun _blockstring_value (Str $str) { |
|
14
|
50
|
|
|
|
38
|
|
|
14
|
50
|
|
|
|
30
|
|
|
14
|
|
|
|
|
40
|
|
|
14
|
|
|
|
|
172
|
|
91
|
|
|
|
|
|
|
# https://facebook.github.io/graphql/June2018/#BlockStringValue() |
92
|
14
|
|
|
|
|
158
|
my @lines = split(/(?:\n|\r(?!\r)|\r\n)/s, $str); |
93
|
14
|
100
|
|
|
|
51
|
if (1 < @lines) { |
94
|
12
|
|
|
|
|
20
|
my $common_indent; |
95
|
12
|
|
|
|
|
58
|
for my $line (@lines[1..$#lines]) { |
96
|
46
|
|
|
|
|
72
|
my $length = length($line); |
97
|
46
|
|
100
|
|
|
192
|
my $indent = length(($line =~ /^([\t ]*)/)[0] || ''); |
98
|
46
|
100
|
100
|
|
|
190
|
if ($indent < $length && (!defined($common_indent) || $indent < $common_indent)) { |
|
|
|
100
|
|
|
|
|
99
|
13
|
|
|
|
|
28
|
$common_indent = $indent; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
} |
102
|
12
|
50
|
|
|
|
73
|
if (defined $common_indent) { |
103
|
12
|
|
|
|
|
40
|
for my $line (@lines[1..$#lines]) { |
104
|
46
|
|
|
|
|
363
|
$line =~ s/^[\t ]{$common_indent}//; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
} |
108
|
14
|
|
|
|
|
37
|
my ($start, $end); |
109
|
14
|
|
66
|
|
|
151
|
for ($start = 0; $start < @lines && $lines[$start] =~ /^[\t ]*$/; ++$start) {} |
110
|
14
|
|
66
|
|
|
156
|
for ($end = $#lines; $end >= 0 && $lines[$end] =~ /^[\t ]*$/; --$end) {} |
111
|
14
|
|
|
|
|
66
|
@lines = @lines[$start..$end]; |
112
|
14
|
|
|
|
|
55
|
my $formatted = join("\n", @lines); |
113
|
14
|
|
|
|
|
40
|
$formatted =~ s/\\"""/"""/g; |
114
|
14
|
|
|
|
|
69
|
return $formatted; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
185
|
50
|
|
185
|
0
|
29796
|
method got_arguments (Any $param = undef) { |
|
185
|
50
|
|
|
|
501
|
|
|
185
|
50
|
|
|
|
362
|
|
|
185
|
|
|
|
|
370
|
|
|
185
|
|
|
|
|
560
|
|
|
185
|
|
|
|
|
1434
|
|
118
|
185
|
50
|
|
|
|
529
|
return unless defined $param; |
119
|
185
|
|
|
|
|
452
|
my %args = map { ($_->[0]{name} => $_->[1]) } @$param; |
|
196
|
|
|
|
|
1358
|
|
120
|
185
|
|
|
|
|
1219
|
return {$self->{parser}{rule} => \%args}; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
201
|
50
|
|
201
|
0
|
8419
|
method got_argument (Any $param = undef) { |
|
201
|
50
|
|
|
|
592
|
|
|
201
|
50
|
|
|
|
373
|
|
|
201
|
|
|
|
|
480
|
|
|
201
|
|
|
|
|
591
|
|
|
201
|
|
|
|
|
1372
|
|
124
|
201
|
50
|
|
|
|
536
|
return unless defined $param; |
125
|
201
|
|
|
|
|
606
|
$param; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
27
|
50
|
|
27
|
0
|
894
|
method got_objectField (Any $param = undef) { |
|
27
|
50
|
|
|
|
93
|
|
|
27
|
50
|
|
|
|
45
|
|
|
27
|
|
|
|
|
65
|
|
|
27
|
|
|
|
|
80
|
|
|
27
|
|
|
|
|
185
|
|
129
|
27
|
50
|
|
|
|
69
|
return unless defined $param; |
130
|
27
|
|
|
|
|
172
|
return {$param->[0]{name} => $param->[1]}; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
14
|
50
|
|
14
|
0
|
2154
|
method got_objectValue (Any $param = undef) { |
|
14
|
50
|
|
|
|
48
|
|
|
14
|
50
|
|
|
|
34
|
|
|
14
|
|
|
|
|
38
|
|
|
14
|
|
|
|
|
50
|
|
|
14
|
|
|
|
|
110
|
|
134
|
14
|
50
|
|
|
|
44
|
return unless defined $param; |
135
|
14
|
|
|
|
|
47
|
_merge_hash($param); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
4
|
50
|
|
4
|
0
|
170
|
method got_objectField_const (Any $param = undef) { |
|
4
|
50
|
|
|
|
14
|
|
|
4
|
50
|
|
|
|
8
|
|
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
32
|
|
139
|
4
|
|
|
|
|
9
|
unshift @_, $self; goto &got_objectField; |
|
4
|
|
|
|
|
16
|
|
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
2
|
50
|
|
2
|
0
|
352
|
method got_objectValue_const (Any $param = undef) { |
|
2
|
50
|
|
|
|
9
|
|
|
2
|
50
|
|
|
|
6
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
18
|
|
143
|
2
|
|
|
|
|
7
|
unshift @_, $self; goto &got_objectValue; |
|
2
|
|
|
|
|
10
|
|
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
9
|
50
|
|
9
|
0
|
5360
|
method got_listValue (Any $param = undef) { |
|
9
|
50
|
|
|
|
33
|
|
|
9
|
50
|
|
|
|
24
|
|
|
9
|
|
|
|
|
35
|
|
|
9
|
|
|
|
|
57
|
|
|
9
|
|
|
|
|
82
|
|
147
|
9
|
50
|
|
|
|
38
|
return unless defined $param; |
148
|
9
|
|
|
|
|
36
|
return $param; |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
2
|
50
|
|
2
|
0
|
1377
|
method got_listValue_const (Any $param = undef) { |
|
2
|
50
|
|
|
|
7
|
|
|
2
|
50
|
|
|
|
6
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
19
|
|
152
|
2
|
|
|
|
|
8
|
unshift @_, $self; goto &got_listValue; |
|
2
|
|
|
|
|
17
|
|
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
|
155
|
74
|
50
|
|
74
|
0
|
5650
|
method got_directiveactual (Any $param = undef) { |
|
74
|
50
|
|
|
|
180
|
|
|
74
|
50
|
|
|
|
132
|
|
|
74
|
|
|
|
|
129
|
|
|
74
|
|
|
|
|
195
|
|
|
74
|
|
|
|
|
518
|
|
156
|
74
|
50
|
|
|
|
160
|
return unless defined $param; |
157
|
74
|
|
|
|
|
166
|
_merge_hash($param); |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
|
160
|
66
|
50
|
|
66
|
0
|
2531
|
method got_inputValueDefinition (Any $param = undef) { |
|
66
|
50
|
|
|
|
175
|
|
|
66
|
50
|
|
|
|
115
|
|
|
66
|
|
|
|
|
113
|
|
|
66
|
|
|
|
|
155
|
|
|
66
|
|
|
|
|
435
|
|
161
|
66
|
50
|
|
|
|
144
|
return unless defined $param; |
162
|
66
|
|
|
|
|
150
|
my $def = _merge_hash($param); |
163
|
66
|
|
|
|
|
525
|
my $name = delete $def->{name}; |
164
|
66
|
|
|
|
|
348
|
return { $name => $def }; |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
12
|
50
|
|
12
|
0
|
1914
|
method got_directiveLocations (Any $param = undef) { |
|
12
|
50
|
|
|
|
37
|
|
|
12
|
50
|
|
|
|
23
|
|
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
50
|
|
|
12
|
|
|
|
|
92
|
|
168
|
12
|
50
|
|
|
|
32
|
return unless defined $param; |
169
|
12
|
|
|
|
|
94
|
return {locations => [ map $_->{name}, @$param ]}; |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
|
172
|
597
|
50
|
|
597
|
0
|
21967
|
method got_namedType (Any $param = undef) { |
|
597
|
50
|
|
|
|
1297
|
|
|
597
|
50
|
|
|
|
985
|
|
|
597
|
|
|
|
|
1029
|
|
|
597
|
|
|
|
|
1320
|
|
|
597
|
|
|
|
|
3899
|
|
173
|
597
|
50
|
|
|
|
1304
|
return unless defined $param; |
174
|
597
|
|
|
|
|
2185
|
return $param->{name}; |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
|
177
|
28
|
50
|
|
28
|
0
|
3818
|
method got_enumValueDefinition (Any $param = undef) { |
|
28
|
50
|
|
|
|
79
|
|
|
28
|
50
|
|
|
|
50
|
|
|
28
|
|
|
|
|
57
|
|
|
28
|
|
|
|
|
73
|
|
|
28
|
|
|
|
|
200
|
|
178
|
28
|
50
|
|
|
|
75
|
return unless defined $param; |
179
|
28
|
|
|
|
|
66
|
my @copy = @$param; |
180
|
28
|
|
|
|
|
57
|
my $rest = pop @copy; |
181
|
28
|
|
|
|
|
41
|
my $value = pop @copy; |
182
|
28
|
|
100
|
|
|
103
|
my $description = $copy[0] // {}; |
183
|
28
|
100
|
|
|
|
86
|
$rest = ref $rest eq 'HASH' ? [ $rest ] : $rest; |
184
|
28
|
|
|
|
|
161
|
my %def = (%$description, value => $value, map %$_, @$rest); |
185
|
28
|
|
|
|
|
129
|
return \%def; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
16
|
50
|
|
16
|
0
|
661
|
method got_defaultValue (Any $param = undef) { |
|
16
|
50
|
|
|
|
44
|
|
|
16
|
50
|
|
|
|
36
|
|
|
16
|
|
|
|
|
40
|
|
|
16
|
|
|
|
|
53
|
|
|
16
|
|
|
|
|
121
|
|
189
|
|
|
|
|
|
|
# the value can be undef |
190
|
16
|
|
|
|
|
69
|
return { default_value => $param }; |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
8
|
50
|
|
8
|
0
|
1007
|
method got_implementsInterfaces (Any $param = undef) { |
|
8
|
50
|
|
|
|
31
|
|
|
8
|
50
|
|
|
|
15
|
|
|
8
|
|
|
|
|
19
|
|
|
8
|
|
|
|
|
29
|
|
|
8
|
|
|
|
|
63
|
|
194
|
8
|
50
|
|
|
|
22
|
return unless defined $param; |
195
|
8
|
|
|
|
|
33
|
return { interfaces => $param }; |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
46
|
50
|
|
46
|
0
|
6911
|
method got_argumentsDefinition (Any $param = undef) { |
|
46
|
50
|
|
|
|
132
|
|
|
46
|
50
|
|
|
|
87
|
|
|
46
|
|
|
|
|
81
|
|
|
46
|
|
|
|
|
134
|
|
|
46
|
|
|
|
|
340
|
|
199
|
46
|
50
|
|
|
|
129
|
return unless defined $param; |
200
|
46
|
|
|
|
|
112
|
return { args => _merge_hash($param) }; |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
118
|
50
|
|
118
|
0
|
14729
|
method got_fieldDefinition (Any $param = undef) { |
|
118
|
50
|
|
|
|
329
|
|
|
118
|
50
|
|
|
|
186
|
|
|
118
|
|
|
|
|
210
|
|
|
118
|
|
|
|
|
315
|
|
|
118
|
|
|
|
|
827
|
|
204
|
118
|
50
|
|
|
|
262
|
return unless defined $param; |
205
|
118
|
|
|
|
|
274
|
my $def = _merge_hash($param); |
206
|
118
|
|
|
|
|
306
|
my $name = delete $def->{name}; |
207
|
118
|
|
|
|
|
628
|
return { $name => $def }; |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
|
210
|
14
|
50
|
|
14
|
0
|
751
|
method got_typeExtensionDefinition (Any $param = undef) { |
|
14
|
50
|
|
|
|
35
|
|
|
14
|
50
|
|
|
|
17
|
|
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
31
|
|
|
14
|
|
|
|
|
97
|
|
211
|
14
|
50
|
|
|
|
30
|
return unless defined $param; |
212
|
14
|
|
|
|
|
18
|
return {kind => 'extend', %{$self->_locate_hash($param)}}; |
|
14
|
|
|
|
|
29
|
|
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
|
215
|
17
|
50
|
|
17
|
0
|
4172
|
method got_enumTypeDefinition (Any $param = undef) { |
|
17
|
50
|
|
|
|
49
|
|
|
17
|
50
|
|
|
|
34
|
|
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
59
|
|
|
17
|
|
|
|
|
130
|
|
216
|
17
|
50
|
|
|
|
40
|
return unless defined $param; |
217
|
17
|
|
|
|
|
45
|
my $def = _merge_hash($param); |
218
|
17
|
|
|
|
|
31
|
my %values; |
219
|
|
|
|
|
|
|
map { |
220
|
28
|
|
|
|
|
55
|
my $name = ${${delete $_->{value}}}; |
|
28
|
|
|
|
|
40
|
|
|
28
|
|
|
|
|
92
|
|
221
|
28
|
|
|
|
|
81
|
$values{$name} = $_; |
222
|
17
|
|
|
|
|
26
|
} @{(grep ref eq 'ARRAY', @$param)[0]}; |
|
17
|
|
|
|
|
63
|
|
223
|
17
|
|
|
|
|
47
|
$def->{values} = \%values; |
224
|
17
|
|
|
|
|
35
|
return {kind => 'enum', %{$self->_locate_hash($def)}}; |
|
17
|
|
|
|
|
45
|
|
225
|
|
|
|
|
|
|
} |
226
|
|
|
|
|
|
|
|
227
|
11
|
50
|
|
11
|
0
|
1314
|
method got_unionMembers (Any $param = undef) { |
|
11
|
50
|
|
|
|
35
|
|
|
11
|
50
|
|
|
|
21
|
|
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
36
|
|
|
11
|
|
|
|
|
84
|
|
228
|
11
|
50
|
|
|
|
31
|
return unless defined $param; |
229
|
11
|
|
|
|
|
45
|
return { types => $param }; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
|
232
|
42
|
50
|
|
42
|
0
|
18441
|
method got_boolean (Any $param = undef) { |
|
42
|
50
|
|
|
|
127
|
|
|
42
|
50
|
|
|
|
77
|
|
|
42
|
|
|
|
|
99
|
|
|
42
|
|
|
|
|
168
|
|
|
42
|
|
|
|
|
1614
|
|
233
|
42
|
50
|
|
|
|
119
|
return unless defined $param; |
234
|
42
|
100
|
|
|
|
289
|
return $param eq 'true' ? JSON->true : JSON->false; |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
6
|
50
|
|
6
|
0
|
2766
|
method got_null (Any $param = undef) { |
|
6
|
50
|
|
|
|
23
|
|
|
6
|
50
|
|
|
|
15
|
|
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
24
|
|
|
6
|
|
|
|
|
51
|
|
238
|
6
|
50
|
|
|
|
20
|
return unless defined $param; |
239
|
6
|
|
|
|
|
22
|
return undef; |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
|
242
|
79
|
50
|
|
79
|
0
|
2927
|
method got_string (Any $param = undef) { |
|
79
|
50
|
|
|
|
243
|
|
|
79
|
50
|
|
|
|
153
|
|
|
79
|
|
|
|
|
174
|
|
|
79
|
|
|
|
|
322
|
|
|
79
|
|
|
|
|
611
|
|
243
|
79
|
50
|
|
|
|
219
|
return unless defined $param; |
244
|
79
|
|
|
|
|
266
|
return $param; |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
|
247
|
65
|
50
|
|
65
|
0
|
27392
|
method got_stringValue (Any $param = undef) { |
|
65
|
50
|
|
|
|
205
|
|
|
65
|
50
|
|
|
|
128
|
|
|
65
|
|
|
|
|
158
|
|
|
65
|
|
|
|
|
212
|
|
|
65
|
|
|
|
|
517
|
|
248
|
65
|
50
|
|
|
|
224
|
return unless defined $param; |
249
|
65
|
|
|
|
|
226
|
return _unescape($param); |
250
|
|
|
|
|
|
|
} |
251
|
|
|
|
|
|
|
|
252
|
14
|
50
|
|
14
|
0
|
5000
|
method got_blockStringValue (Any $param = undef) { |
|
14
|
50
|
|
|
|
44
|
|
|
14
|
50
|
|
|
|
28
|
|
|
14
|
|
|
|
|
28
|
|
|
14
|
|
|
|
|
52
|
|
|
14
|
|
|
|
|
115
|
|
253
|
14
|
50
|
|
|
|
49
|
return unless defined $param; |
254
|
14
|
|
|
|
|
52
|
return _blockstring_value($param); |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
|
257
|
27
|
50
|
|
27
|
0
|
8533
|
method got_int (Any $param = undef) { |
|
27
|
50
|
|
|
|
85
|
|
|
27
|
50
|
|
|
|
54
|
|
|
27
|
|
|
|
|
63
|
|
|
27
|
|
|
|
|
107
|
|
|
27
|
|
|
|
|
224
|
|
258
|
27
|
|
|
|
|
119
|
$param+0; |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
15
|
50
|
|
15
|
0
|
3221
|
method got_float (Any $param = undef) { |
|
15
|
50
|
|
|
|
38
|
|
|
15
|
50
|
|
|
|
24
|
|
|
15
|
|
|
|
|
26
|
|
|
15
|
|
|
|
|
43
|
|
|
15
|
|
|
|
|
106
|
|
262
|
15
|
|
|
|
|
83
|
$param+0; |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
45
|
50
|
|
45
|
0
|
1563
|
method got_enumValue (Any $param = undef) { |
|
45
|
50
|
|
|
|
119
|
|
|
45
|
50
|
|
|
|
90
|
|
|
45
|
|
|
|
|
90
|
|
|
45
|
|
|
|
|
136
|
|
|
45
|
|
|
|
|
316
|
|
266
|
45
|
50
|
|
|
|
122
|
return unless defined $param; |
267
|
45
|
|
|
|
|
106
|
my $varname = $param->{name}; |
268
|
45
|
|
|
|
|
167
|
return \\$varname; |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
# not returning empty list if undef |
272
|
1080
|
50
|
|
1080
|
0
|
3283
|
method got_value_const (Any $param = undef) { |
|
1080
|
50
|
|
|
|
2307
|
|
|
1080
|
50
|
|
|
|
1760
|
|
|
1080
|
|
|
|
|
2064
|
|
|
1080
|
|
|
|
|
2456
|
|
|
1080
|
|
|
|
|
6794
|
|
273
|
1080
|
|
|
|
|
3213
|
return $param; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
237
|
50
|
|
237
|
0
|
9069
|
method got_value (Any $param = undef) { |
|
237
|
50
|
|
|
|
657
|
|
|
237
|
50
|
|
|
|
399
|
|
|
237
|
|
|
|
|
471
|
|
|
237
|
|
|
|
|
706
|
|
|
237
|
|
|
|
|
1659
|
|
277
|
237
|
|
|
|
|
556
|
unshift @_, $self; goto &got_value_const; |
|
237
|
|
|
|
|
941
|
|
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
54
|
50
|
|
54
|
0
|
10661
|
method got_variableDefinitions (Any $param = undef) { |
|
54
|
50
|
|
|
|
169
|
|
|
54
|
50
|
|
|
|
115
|
|
|
54
|
|
|
|
|
142
|
|
|
54
|
|
|
|
|
197
|
|
|
54
|
|
|
|
|
418
|
|
281
|
54
|
50
|
|
|
|
174
|
return unless defined $param; |
282
|
54
|
|
|
|
|
125
|
my %def; |
283
|
|
|
|
|
|
|
map { |
284
|
54
|
|
|
|
|
131
|
my $name = ${ shift @$_ }; |
|
55
|
|
|
|
|
110
|
|
|
55
|
|
|
|
|
155
|
|
285
|
55
|
|
|
|
|
488
|
$def{$name} = { map %$_, @$_ }; # merge |
286
|
|
|
|
|
|
|
} @$param; |
287
|
54
|
|
|
|
|
388
|
return {variables => \%def}; |
288
|
|
|
|
|
|
|
} |
289
|
|
|
|
|
|
|
|
290
|
55
|
50
|
|
55
|
0
|
2165
|
method got_variableDefinition (Any $param = undef) { |
|
55
|
50
|
|
|
|
178
|
|
|
55
|
50
|
|
|
|
110
|
|
|
55
|
|
|
|
|
130
|
|
|
55
|
|
|
|
|
172
|
|
|
55
|
|
|
|
|
402
|
|
291
|
55
|
50
|
|
|
|
182
|
return unless defined $param; |
292
|
55
|
|
|
|
|
168
|
return $param; |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
|
295
|
820
|
50
|
|
820
|
0
|
30527
|
method got_selection (Any $param = undef) { |
|
820
|
50
|
|
|
|
1914
|
|
|
820
|
50
|
|
|
|
1336
|
|
|
820
|
|
|
|
|
1419
|
|
|
820
|
|
|
|
|
1947
|
|
|
820
|
|
|
|
|
5238
|
|
296
|
820
|
|
|
|
|
1660
|
unshift @_, $self; goto &got_value_const; |
|
820
|
|
|
|
|
2670
|
|
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
278
|
50
|
|
278
|
0
|
9655
|
method got_typedef (Any $param = undef) { |
|
278
|
50
|
|
|
|
668
|
|
|
278
|
50
|
|
|
|
418
|
|
|
278
|
|
|
|
|
504
|
|
|
278
|
|
|
|
|
676
|
|
|
278
|
|
|
|
|
1865
|
|
300
|
278
|
50
|
|
|
|
629
|
return unless defined $param; |
301
|
278
|
50
|
|
|
|
734
|
$param = $param->{name} if ref($param) eq 'HASH'; |
302
|
278
|
|
|
|
|
1008
|
return {type => $param}; |
303
|
|
|
|
|
|
|
} |
304
|
|
|
|
|
|
|
|
305
|
30
|
50
|
|
30
|
0
|
2532
|
method got_alias (Any $param = undef) { |
|
30
|
50
|
|
|
|
99
|
|
|
30
|
50
|
|
|
|
77
|
|
|
30
|
|
|
|
|
74
|
|
|
30
|
|
|
|
|
106
|
|
|
30
|
|
|
|
|
237
|
|
306
|
30
|
50
|
|
|
|
90
|
return unless defined $param; |
307
|
30
|
|
|
|
|
204
|
return {$self->{parser}{rule} => $param->{name}}; |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
|
310
|
50
|
50
|
|
50
|
0
|
2029
|
method got_typeCondition (Any $param = undef) { |
|
50
|
50
|
|
|
|
152
|
|
|
50
|
50
|
|
|
|
97
|
|
|
50
|
|
|
|
|
116
|
|
|
50
|
|
|
|
|
147
|
|
|
50
|
|
|
|
|
352
|
|
311
|
50
|
50
|
|
|
|
157
|
return unless defined $param; |
312
|
50
|
|
|
|
|
210
|
return {on => $param}; |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
66
|
50
|
|
66
|
0
|
2337
|
method got_fragmentName (Any $param = undef) { |
|
66
|
50
|
|
|
|
168
|
|
|
66
|
50
|
|
|
|
112
|
|
|
66
|
|
|
|
|
122
|
|
|
66
|
|
|
|
|
201
|
|
|
66
|
|
|
|
|
441
|
|
316
|
66
|
50
|
|
|
|
171
|
return unless defined $param; |
317
|
66
|
|
|
|
|
187
|
return $param; |
318
|
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
|
320
|
563
|
50
|
|
563
|
0
|
299892
|
method got_selectionSet (Any $param = undef) { |
|
563
|
50
|
|
|
|
1386
|
|
|
563
|
50
|
|
|
|
970
|
|
|
563
|
|
|
|
|
1059
|
|
|
563
|
|
|
|
|
1710
|
|
|
563
|
|
|
|
|
4115
|
|
321
|
563
|
50
|
|
|
|
1277
|
return unless defined $param; |
322
|
563
|
|
|
|
|
2243
|
return {selections => $param}; |
323
|
|
|
|
|
|
|
} |
324
|
|
|
|
|
|
|
|
325
|
264
|
50
|
|
264
|
0
|
12521
|
method got_operationDefinition (Any $param = undef) { |
|
264
|
50
|
|
|
|
761
|
|
|
264
|
50
|
|
|
|
546
|
|
|
264
|
|
|
|
|
573
|
|
|
264
|
|
|
|
|
839
|
|
|
264
|
|
|
|
|
1853
|
|
326
|
264
|
50
|
|
|
|
736
|
return unless defined $param; |
327
|
264
|
100
|
|
|
|
945
|
$param = [ $param ] unless ref $param eq 'ARRAY'; # bare selectionSet |
328
|
264
|
|
|
|
|
523
|
return {kind => 'operation', %{$self->_locate_hash(_merge_hash($param))}}; |
|
264
|
|
|
|
|
686
|
|
329
|
|
|
|
|
|
|
} |
330
|
|
|
|
|
|
|
|
331
|
71
|
50
|
|
71
|
0
|
5737
|
method got_directives (Any $param = undef) { |
|
71
|
50
|
|
|
|
156
|
|
|
71
|
50
|
|
|
|
122
|
|
|
71
|
|
|
|
|
122
|
|
|
71
|
|
|
|
|
211
|
|
|
71
|
|
|
|
|
568
|
|
332
|
71
|
50
|
|
|
|
173
|
return unless defined $param; |
333
|
71
|
|
|
|
|
288
|
return {$self->{parser}{rule} => $param}; |
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
|
336
|
323
|
50
|
|
323
|
0
|
239690
|
method got_graphql (Any $param = undef) { |
|
323
|
50
|
|
|
|
981
|
|
|
323
|
50
|
|
|
|
616
|
|
|
323
|
|
|
|
|
655
|
|
|
323
|
|
|
|
|
1171
|
|
|
323
|
|
|
|
|
2444
|
|
337
|
323
|
50
|
|
|
|
939
|
return unless defined $param; |
338
|
323
|
|
|
|
|
1080
|
return $param; |
339
|
|
|
|
|
|
|
} |
340
|
|
|
|
|
|
|
|
341
|
590
|
50
|
|
590
|
0
|
21885
|
method got_definition (Any $param = undef) { |
|
590
|
50
|
|
|
|
1458
|
|
|
590
|
50
|
|
|
|
1020
|
|
|
590
|
|
|
|
|
1166
|
|
|
590
|
|
|
|
|
1607
|
|
|
590
|
|
|
|
|
4223
|
|
342
|
590
|
100
|
|
|
|
1592
|
return unless defined $param; |
343
|
487
|
|
|
|
|
1335
|
return $param; |
344
|
|
|
|
|
|
|
} |
345
|
|
|
|
|
|
|
|
346
|
54
|
50
|
|
54
|
0
|
2045
|
method got_operationTypeDefinition (Any $param = undef) { |
|
54
|
50
|
|
|
|
123
|
|
|
54
|
50
|
|
|
|
96
|
|
|
54
|
|
|
|
|
122
|
|
|
54
|
|
|
|
|
155
|
|
|
54
|
|
|
|
|
388
|
|
347
|
54
|
50
|
|
|
|
127
|
return unless defined $param; |
348
|
54
|
100
|
|
|
|
118
|
return { map { ref($_) ? values %$_ : $_ } @$param }; |
|
108
|
|
|
|
|
588
|
|
349
|
|
|
|
|
|
|
} |
350
|
|
|
|
|
|
|
|
351
|
0
|
0
|
|
0
|
0
|
0
|
method got_comment (Any $param = undef) { |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
352
|
0
|
0
|
|
|
|
0
|
return unless defined $param; |
353
|
0
|
|
|
|
|
0
|
return $param; |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
1026
|
50
|
|
1026
|
0
|
35623
|
method got_description (Any $param = undef) { |
|
1026
|
50
|
|
|
|
2202
|
|
|
1026
|
50
|
|
|
|
1609
|
|
|
1026
|
|
|
|
|
1831
|
|
|
1026
|
|
|
|
|
2348
|
|
|
1026
|
|
|
|
|
6781
|
|
357
|
1026
|
100
|
|
|
|
3289
|
return unless defined $param; |
358
|
16
|
50
|
|
|
|
64
|
my $string = ref($param) eq 'ARRAY' ? join("\n", @$param) : $param; |
359
|
16
|
50
|
|
|
|
76
|
return $string ? {$self->{parser}{rule} => $string} : {}; |
360
|
|
|
|
|
|
|
} |
361
|
|
|
|
|
|
|
|
362
|
44
|
50
|
|
44
|
0
|
7627
|
method got_schema (Any $param = undef) { |
|
44
|
50
|
|
|
|
130
|
|
|
44
|
50
|
|
|
|
74
|
|
|
44
|
|
|
|
|
107
|
|
|
44
|
|
|
|
|
133
|
|
|
44
|
|
|
|
|
327
|
|
363
|
44
|
50
|
|
|
|
121
|
return unless defined $param; |
364
|
44
|
|
|
|
|
84
|
my $directives = {}; |
365
|
44
|
100
|
|
|
|
161
|
if (ref $param->[1] eq 'ARRAY') { |
366
|
|
|
|
|
|
|
# got directives |
367
|
3
|
|
|
|
|
15
|
$directives = shift @$param; |
368
|
|
|
|
|
|
|
} |
369
|
44
|
|
|
|
|
73
|
my %type2count; |
370
|
44
|
|
|
|
|
76
|
$type2count{(keys %$_)[0]}++ for @{$param->[0]}; |
|
44
|
|
|
|
|
248
|
|
371
|
|
|
|
|
|
|
$type2count{$_} > 1 and die "Must provide only one $_ type in schema.\n" |
372
|
44
|
|
100
|
|
|
261
|
for keys %type2count; |
373
|
41
|
|
|
|
|
111
|
return {kind => $self->{parser}{rule}, %{$self->_locate_hash(_merge_hash($param->[0]))}, %$directives}; |
|
41
|
|
|
|
|
118
|
|
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
196
|
50
|
|
196
|
0
|
10437
|
method got_typeSystemDefinition (Any $param = undef) { |
|
196
|
50
|
|
|
|
429
|
|
|
196
|
50
|
|
|
|
306
|
|
|
196
|
|
|
|
|
328
|
|
|
196
|
|
|
|
|
421
|
|
|
196
|
|
|
|
|
1354
|
|
377
|
196
|
50
|
|
|
|
424
|
return unless defined $param; |
378
|
196
|
|
|
|
|
402
|
my @copy = @$param; |
379
|
196
|
|
|
|
|
316
|
my $node = pop @copy; |
380
|
196
|
|
100
|
|
|
760
|
my $description = $copy[0] // {}; |
381
|
196
|
|
|
|
|
1262
|
+{ %$node, %$description }; |
382
|
|
|
|
|
|
|
} |
383
|
|
|
|
|
|
|
|
384
|
143
|
50
|
|
143
|
0
|
5250
|
method got_typeDefinition (Any $param = undef) { |
|
143
|
50
|
|
|
|
340
|
|
|
143
|
50
|
|
|
|
268
|
|
|
143
|
|
|
|
|
236
|
|
|
143
|
|
|
|
|
392
|
|
|
143
|
|
|
|
|
1014
|
|
385
|
143
|
50
|
|
|
|
314
|
return unless defined $param; |
386
|
143
|
|
|
|
|
358
|
return $param; |
387
|
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
|
389
|
123
|
50
|
|
123
|
0
|
5141
|
method got_variable (Any $param = undef) { |
|
123
|
50
|
|
|
|
354
|
|
|
123
|
50
|
|
|
|
231
|
|
|
123
|
|
|
|
|
330
|
|
|
123
|
|
|
|
|
389
|
|
|
123
|
|
|
|
|
905
|
|
390
|
123
|
50
|
|
|
|
322
|
return unless defined $param; |
391
|
123
|
|
|
|
|
316
|
my $varname = $param->{name}; |
392
|
123
|
|
|
|
|
468
|
return \$varname; |
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
|
395
|
54
|
50
|
|
54
|
0
|
5358
|
method got_nonNullType (Any $param = undef) { |
|
54
|
50
|
|
|
|
191
|
|
|
54
|
50
|
|
|
|
105
|
|
|
54
|
|
|
|
|
118
|
|
|
54
|
|
|
|
|
196
|
|
|
54
|
|
|
|
|
414
|
|
396
|
54
|
50
|
|
|
|
152
|
return unless defined $param; |
397
|
54
|
|
|
|
|
138
|
$param = $param->[0]; # zap first useless layer |
398
|
54
|
50
|
|
|
|
235
|
$param = { type => $param } if ref $param ne 'HASH'; |
399
|
54
|
|
|
|
|
210
|
return [ 'non_null', $param ]; |
400
|
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
|
402
|
38
|
50
|
|
38
|
0
|
1548
|
method got_listType (Any $param = undef) { |
|
38
|
50
|
|
|
|
109
|
|
|
38
|
50
|
|
|
|
75
|
|
|
38
|
|
|
|
|
90
|
|
|
38
|
|
|
|
|
114
|
|
|
38
|
|
|
|
|
309
|
|
403
|
38
|
50
|
|
|
|
111
|
return unless defined $param; |
404
|
38
|
|
|
|
|
86
|
$param = $param->[0]; # zap first useless layer |
405
|
38
|
50
|
|
|
|
134
|
$param = { type => $param } if ref $param ne 'HASH'; |
406
|
38
|
|
|
|
|
133
|
return [ 'list', $param ]; |
407
|
|
|
|
|
|
|
} |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
1; |