You are here

class Introspection in GraphQL 8.4

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

Runs introspection queries against a GraphQL server.

Hierarchy

Expanded class hierarchy of Introspection

2 files declare their use of Introspection
ExplorerController.php in src/Controller/ExplorerController.php
VoyagerController.php in src/Controller/VoyagerController.php
1 string reference to 'Introspection'
graphql.services.yml in ./graphql.services.yml
graphql.services.yml
1 service uses Introspection
graphql.introspection in ./graphql.services.yml
Drupal\graphql\GraphQL\Utility\Introspection

File

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

Namespace

Drupal\graphql\GraphQL\Utility
View source
class Introspection {

  /**
   * Perform an introspection query and return result.
   *
   * @param \Drupal\graphql\Entity\ServerInterface $server
   *   The server instance.
   *
   * @return array
   *   The introspection result as an array.
   */
  public function introspect(ServerInterface $server) {
    $operation = new OperationParams();
    $operation->query = IntrospectionType::getIntrospectionQuery([
      'descriptions' => TRUE,
    ]);
    $result = $server
      ->executeOperation($operation);
    return $result
      ->toArray();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Introspection::introspect public function Perform an introspection query and return result.