File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,6 @@ public function parseValue($value)
27
27
28
28
public function parseLiteral ($ valueNode , ?array $ variables = null )
29
29
{
30
- return AST ::valueFromASTUntyped ($ valueNode );
30
+ return AST ::valueFromASTUntyped ($ valueNode, $ variables );
31
31
}
32
32
}
Original file line number Diff line number Diff line change @@ -135,6 +135,40 @@ public static function literalToPhpMap(): iterable
135
135
];
136
136
}
137
137
138
+ public function testIncludesVariablesInLiterals (): void
139
+ {
140
+ $ query = /** @lang GraphQL */ '
141
+ query ($a: Mixed, $b1: Mixed, $b3: Mixed) {
142
+ foo(bar: {
143
+ a: $a,
144
+ bs: [$b1, 2, $b3]
145
+ })
146
+ }
147
+ ' ;
148
+
149
+ $ result = GraphQL::executeQuery (
150
+ $ this ->schema ,
151
+ $ query ,
152
+ null ,
153
+ null ,
154
+ [
155
+ 'a ' => 'foo ' ,
156
+ 'b1 ' => 1 ,
157
+ 'b3 ' => 3 ,
158
+ ]
159
+ );
160
+
161
+ self ::assertSame (
162
+ [
163
+ 'foo ' => [
164
+ 'a ' => 'foo ' ,
165
+ 'bs ' => [1 , 2 , 3 ],
166
+ ],
167
+ ],
168
+ $ result ->data
169
+ );
170
+ }
171
+
138
172
private function executeQueryWithLiteral (string $ literal ): ExecutionResult
139
173
{
140
174
$ query = /** @lang GraphQL */ "
You can’t perform that action at this time.
0 commit comments