$query]; if (! empty($variables)) { $payload['variables'] = $variables; } $headers = array_merge($this->storefrontHeaders(), $headers); return $this->postJson($this->graphqlUrl, $payload, $headers); } /** * Execute an authenticated GraphQL query (storefront key + customer token) */ protected function authenticatedGraphQL(Customer $customer, string $query, array $variables = []): TestResponse { $payload = ['query' => $query]; if (! empty($variables)) { $payload['variables'] = $variables; } return $this->actingAs($customer) ->withHeaders($this->authHeaders($customer)) ->postJson($this->graphqlUrl, $payload); } }