File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,14 @@ private function getParams(Request $request, array $data = []): array
9595 static ::PARAM_OPERATION_NAME => null ,
9696 ];
9797
98- // Keep a reference to the query-string
99- $ qs = $ request ->query ;
98+ // Use all query parameters, since starting from Symfony 6 there will be an exception accessing array parameters
99+ // via request->query->get(key), and another exception accessing non-array parameter via request->query->all(key)
100+ $ queryParameters = $ request ->query ->all ();
100101
101102 // Override request using query-string parameters
102- $ query = $ qs -> has ( static ::PARAM_QUERY ) ? $ qs -> get ( static :: PARAM_QUERY ) : $ data [static ::PARAM_QUERY ];
103- $ variables = $ qs -> has ( static ::PARAM_VARIABLES ) ? $ qs -> get ( static :: PARAM_VARIABLES ) : $ data [static ::PARAM_VARIABLES ];
104- $ operationName = $ qs -> has ( static ::PARAM_OPERATION_NAME ) ? $ qs -> get ( static :: PARAM_OPERATION_NAME ) : $ data [static ::PARAM_OPERATION_NAME ];
103+ $ query = $ queryParameters [ static ::PARAM_QUERY ] ?? $ data [static ::PARAM_QUERY ];
104+ $ variables = $ queryParameters [ static ::PARAM_VARIABLES ] ?? $ data [static ::PARAM_VARIABLES ];
105+ $ operationName = $ queryParameters [ static ::PARAM_OPERATION_NAME ] ?? $ data [static ::PARAM_OPERATION_NAME ];
105106
106107 // `query` parameter is mandatory.
107108 if (empty ($ query )) {
You can’t perform that action at this time.
0 commit comments