You are here

protected function QueryProcessor::filterCacheContexts in GraphQL 8.3

Filter unused contexts.

Removes the language contexts from a list of context ids.

Parameters

string[] $contexts: The list of context id's.

Return value

string[] The filtered list of context id's.

File

src/GraphQL/Execution/QueryProcessor.php, line 509

Class

QueryProcessor

Namespace

Drupal\graphql\GraphQL\Execution

Code

protected function filterCacheContexts(array $contexts) {
  return array_filter($contexts, function ($context) {
    return strpos($context, 'languages:') !== 0;
  });
}