You are here

public function Introspection::introspect in GraphQL 8.4

Same name and namespace in other branches
  1. 8.3 src/GraphQL/Utility/Introspection.php \Drupal\graphql\GraphQL\Utility\Introspection::introspect()

Perform an introspection query and return result.

Parameters

\Drupal\graphql\Entity\ServerInterface $server: The server instance.

Return value

array The introspection result as an array.

File

src/GraphQL/Utility/Introspection.php, line 23

Class

Introspection
Runs introspection queries against a GraphQL server.

Namespace

Drupal\graphql\GraphQL\Utility

Code

public function introspect(ServerInterface $server) {
  $operation = new OperationParams();
  $operation->query = IntrospectionType::getIntrospectionQuery([
    'descriptions' => TRUE,
  ]);
  $result = $server
    ->executeOperation($operation);
  return $result
    ->toArray();
}