diff --git a/_legacy/SnapshotScaffoldingProvider.php b/_legacy/SnapshotScaffoldingProvider.php index 80b6455..79212df 100644 --- a/_legacy/SnapshotScaffoldingProvider.php +++ b/_legacy/SnapshotScaffoldingProvider.php @@ -3,14 +3,17 @@ namespace SilverStripe\SnapshotAdmin; +use SilverStripe\Admin\GraphQL\ReadOneLegacyResolver; use SilverStripe\CMS\Model\SiteTree; use SilverStripe\Core\ClassInfo; use SilverStripe\GraphQL\Scaffolding\Interfaces\ScaffoldingProvider; +use SilverStripe\GraphQL\Scaffolding\Scaffolders\CRUD\ReadOne; use SilverStripe\GraphQL\Scaffolding\Scaffolders\SchemaScaffolder; +use SilverStripe\GraphQL\Scaffolding\StaticSchema; use SilverStripe\ORM\DataObject; use SilverStripe\Security\Member; -if (!interface_exists(ScaffoldingProvider::class)) { +if (!interface_exists(ScaffoldingProvider::class) || !class_exists(ReadOneLegacyResolver::class)) { return; } @@ -46,6 +49,7 @@ public function provideGraphQLScaffolding(SchemaScaffolder $scaffolder) ->addFields($fields) ->operation(SchemaScaffolder::READ_ONE) ->addArg('filter', 'IDFilterType!') + ->setResolver(new ReadOneLegacyResolver($inst)) ->end() ->operation('rollback'); }