public function QueryFileTrait::getQueryFromFile in GraphQL 8.4
Same name and namespace in other branches
- 8.3 tests/src/Traits/QueryFileTrait.php \Drupal\Tests\graphql\Traits\QueryFileTrait::getQueryFromFile()
Retrieve the GraphQL query stored in a file as string.
Parameters
string $queryFile: The query file name.
Return value
string The graphql query string.
1 call to QueryFileTrait::getQueryFromFile()
- BufferedFieldTest::testBatchedFields in tests/
src/ Kernel/ Framework/ BufferedFieldTest.php - Test if the schema is created properly.
File
- tests/
src/ Traits/ QueryFileTrait.php, line 29
Class
- QueryFileTrait
- Trait for retrieving GraphQL queries from files.
Namespace
Drupal\Tests\graphql\TraitsCode
public function getQueryFromFile($queryFile) {
return file_get_contents($this
->getQueriesDirectory() . '/' . $queryFile);
}