You are here

public function Introspection::introspect in GraphQL 8.3

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

Perform an introspection query and return result.

Parameters

string $schema: The name of the graphql schema to introspect.

Return value

array The introspection result as an array. The introspection result as an array.

File

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

Class

Introspection

Namespace

Drupal\graphql\GraphQL\Utility

Code

public function introspect($schema) {
  $query = IntrospectionType::getIntrospectionQuery([
    'descriptions' => TRUE,
  ]);
  $operation = OperationParams::create([
    'query' => $query,
  ]);
  $result = $this->queryProcessor
    ->processQuery($schema, $operation);
  return $result
    ->toArray();
}