You are here

public function ThunderGqlsTestBase::getQueryFromFile in Thunder 6.2.x

Retrieve the GraphQL query stored in a file as string.

Parameters

string $name: The example name.

Return value

string The graphql query string.

1 call to ThunderGqlsTestBase::getQueryFromFile()
ThunderGqlsTestBase::runAndTestQuery in modules/thunder_gqls/tests/src/Functional/ThunderGqlsTestBase.php
Execute query and compare to expected response.

File

modules/thunder_gqls/tests/src/Functional/ThunderGqlsTestBase.php, line 103

Class

ThunderGqlsTestBase
The base class for all functional Thunder GraphQl schema tests.

Namespace

Drupal\Tests\thunder_gqls\Functional

Code

public function getQueryFromFile(string $name) : string {
  return file_get_contents($this
    ->getQueriesDirectory() . '/' . $name . '.query.graphql');
}