You are here

public function LanguageContextTest::testDeferredLanguage in GraphQL 8.3

Test deferred language resolvers.

File

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

Class

LanguageContextTest
Test contextual language negotiation.

Namespace

Drupal\Tests\graphql\Kernel\Framework

Code

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