private function ThunderSchema::resolveBaseTypes in Thunder 6.2.x
Resolve custom types, that are used in multiple places.
1 call to ThunderSchema::resolveBaseTypes()
- ThunderSchema::getResolverRegistry in modules/
thunder_gqls/ src/ Plugin/ GraphQL/ Schema/ ThunderSchema.php
File
- modules/
thunder_gqls/ src/ Plugin/ GraphQL/ Schema/ ThunderSchema.php, line 116
Class
- ThunderSchema
- Tha base schema for Thunder composable schema.
Namespace
Drupal\thunder_gqls\Plugin\GraphQL\SchemaCode
private function resolveBaseTypes() {
$this
->addFieldResolverIfNotExists('Link', 'url', $this->builder
->callback(function ($parent) {
if (!empty($parent) && isset($parent['uri'])) {
$urlObject = Url::fromUri($parent['uri']);
$url = $urlObject
->toString(TRUE)
->getGeneratedUrl();
}
return $url ?? '';
}));
$this
->addSimpleCallbackFields('Link', [
'title',
]);
$this
->addSimpleCallbackFields('FocalPoint', [
'x',
'y',
]);
$this
->addSimpleCallbackFields('Redirect', [
'url',
'status',
]);
$this
->addSimpleCallbackFields('EntityLinks', [
'canonical',
'deleteForm',
'deleteMultipleForm',
'editForm',
'versionHistory',
'revision',
'create',
'latestVersion',
]);
$this
->addSimpleCallbackFields('Thumbnail', [
'src',
'width',
'height',
'alt',
'title',
]);
$this
->addSimpleCallbackFields('ImageDerivative', [
'src',
'width',
'height',
]);
$this
->addSimpleCallbackFields('Schema', [
'query',
]);
}