materio_simplenews & materio_graphql fix
This commit is contained in:
-26
@@ -4,7 +4,6 @@ namespace Drupal\materio_graphql\Plugin\GraphQL\SchemaExtension;
|
||||
|
||||
use Drupal\graphql\GraphQL\ResolverBuilder;
|
||||
use Drupal\graphql\GraphQL\ResolverRegistryInterface;
|
||||
use Drupal\graphql\GraphQL\Response\ResponseInterface;
|
||||
use Drupal\graphql\Plugin\GraphQL\SchemaExtension\SdlSchemaExtensionPluginBase;
|
||||
use Drupal\Core\Url;
|
||||
// use CommerceGuys\Addressing\Country\CountryRepository;
|
||||
@@ -103,12 +102,6 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
$this->addVideolink($registry, $builder);
|
||||
|
||||
$this->addImage($registry, $builder);
|
||||
|
||||
// Response type resolver.
|
||||
$registry->addTypeResolver('Response', [
|
||||
__CLASS__,
|
||||
'resolveResponse',
|
||||
]);
|
||||
}
|
||||
|
||||
// ___ _
|
||||
@@ -1617,24 +1610,5 @@ class MaterioSchemaExtension extends SdlSchemaExtensionPluginBase {
|
||||
})
|
||||
));
|
||||
}
|
||||
/**
|
||||
* Resolves the response type.
|
||||
*
|
||||
* @param \Drupal\graphql\GraphQL\Response\ResponseInterface $response
|
||||
* Response object.
|
||||
*
|
||||
* @return string
|
||||
* Response type.
|
||||
*
|
||||
* @throws \Exception
|
||||
* Invalid response type.
|
||||
*/
|
||||
public static function resolveResponse(ResponseInterface $response): string {
|
||||
// Resolve content response.
|
||||
if ($response instanceof MateriauResponse) {
|
||||
return 'MateriauResponse';
|
||||
}
|
||||
throw new \Exception('Invalid response type.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user