You are here

public function LanguageContextTest::testUnawareField in GraphQL 8.3

Test an language unaware field.

If a field doesn't declare language cache contexts, the context is not inactive and the standard language negotiation should kick in.

File

tests/src/Kernel/Framework/LanguageContextTest.php, line 232

Class

LanguageContextTest
Test contextual language negotiation.

Namespace

Drupal\Tests\graphql\Kernel\Framework

Code

public function testUnawareField() {
  $query = <<<GQL
query {
  edge(language: "fr") {
    unaware
  }
}
GQL;
  $this
    ->assertResults($query, [], [
    'edge' => [
      'unaware' => 'en',
    ],
  ], $this
    ->defaultCacheMetaData());
}