class Introspection in GraphQL 8.3
Same name and namespace in other branches
- 8.4 src/GraphQL/Utility/Introspection.php \Drupal\graphql\GraphQL\Utility\Introspection
Hierarchy
- class \Drupal\graphql\GraphQL\Utility\Introspection
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'
1 service uses Introspection
File
- src/
GraphQL/ Utility/ Introspection.php, line 9
Namespace
Drupal\graphql\GraphQL\UtilityView source
class Introspection {
/**
* @var \Drupal\graphql\GraphQL\Execution\QueryProcessor
*/
protected $queryProcessor;
/**
* Constructs an Introspection object.
*
* @param \Drupal\graphql\GraphQL\Execution\QueryProcessor $queryProcessor
* The query processor srevice.
*/
public function __construct(QueryProcessor $queryProcessor) {
$this->queryProcessor = $queryProcessor;
}
/**
* Perform an introspection query and return result.
*
* @param string $schema
* The name of the graphql schema to introspect.
*
* @return array The introspection result as an array.
* The introspection result as an array.
*/
public function introspect($schema) {
$query = IntrospectionType::getIntrospectionQuery([
'descriptions' => TRUE,
]);
$operation = OperationParams::create([
'query' => $query,
]);
$result = $this->queryProcessor
->processQuery($schema, $operation);
return $result
->toArray();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Introspection:: |
protected | property | ||
Introspection:: |
public | function | Perform an introspection query and return result. | |
Introspection:: |
public | function | Constructs an Introspection object. |