You are here

public static function DeferredUtility::containsDeferred in GraphQL 8.4

Checks if there are any deferred values in the given array.

Parameters

array $values: The array to check for deferred values.

Return value

bool TRUE if there are any deferred values in the given array.

1 call to DeferredUtility::containsDeferred()
DeferredUtility::waitAll in src/GraphQL/Utility/DeferredUtility.php
Ensures that all promises in the given array are resolved.

File

src/GraphQL/Utility/DeferredUtility.php, line 115

Class

DeferredUtility
Helper class for dealing with deferred promises.

Namespace

Drupal\graphql\GraphQL\Utility

Code

public static function containsDeferred(array $values) {
  foreach ($values as $value) {
    if ($value instanceof SyncPromise) {
      return TRUE;
    }
  }
  return FALSE;
}