protected function HttpRequestTrait::query in GraphQL 8.3
Same name and namespace in other branches
- 8.4 tests/src/Traits/HttpRequestTrait.php \Drupal\Tests\graphql\Traits\HttpRequestTrait::query()
Issue a simple query over http.
Parameters
string $query: The query string.
array $variables: Query variables.
Return value
\Symfony\Component\HttpFoundation\Response The http response object.
12 calls to HttpRequestTrait::query()
- DisabledResultCacheTest::testDisabledCache in tests/
src/ Kernel/ Framework/ DisabledResultCacheTest.php - Test if disabling the result cache has the desired effect.
- EntityRevisionsTest::testNodeContext in modules/
graphql_core/ tests/ src/ Kernel/ Entity/ EntityRevisionsTest.php - Regression test for unhandled logic exceptions.
- NodeContextTest::testNodeContext in modules/
graphql_core/ tests/ src/ Kernel/ Context/ NodeContextTest.php - Regression test for unhandled logic exceptions.
- ResultCacheTest::testCacheableResult in tests/
src/ Kernel/ Framework/ ResultCacheTest.php - Check basic result caching.
- ResultCacheTest::testContext in tests/
src/ Kernel/ Framework/ ResultCacheTest.php - Test if changing test context's trigger re-evaluations.
File
- tests/
src/ Traits/ HttpRequestTrait.php, line 23
Class
- HttpRequestTrait
- Test trait for the GraphQL HTTP interface.
Namespace
Drupal\Tests\graphql\TraitsCode
protected function query($query, array $variables = []) {
return $this->container
->get('http_kernel')
->handle(Request::create('/graphql', 'GET', [
'query' => $query,
'variables' => $variables,
]));
}