You are here

public static function DocumentSerializer::serializeDocument in GraphQL 8.4

Turn the AST document to a serializable array.

Parameters

\GraphQL\Language\AST\DocumentNode $document:

Return value

array

1 call to DocumentSerializer::serializeDocument()
Executor::cachePrefix in src/GraphQL/Execution/Executor.php
Calculates the cache prefix from context for the current query.

File

src/GraphQL/Utility/DocumentSerializer.php, line 20

Class

DocumentSerializer
Cleans up AST recursively for serialization.

Namespace

Drupal\graphql\GraphQL\Utility

Code

public static function serializeDocument(DocumentNode $document) {
  return static::sanitizeRecursive(AST::toArray($document));
}