From 74536214e728980acc7a9fcfebe700039d621ebd Mon Sep 17 00:00:00 2001 From: Mohamed Alsharaf Date: Tue, 7 Sep 2021 10:21:47 +1200 Subject: [PATCH] Update readone resolver to match legacy resolver in CMS page --- _legacy/SnapshotScaffoldingProvider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/_legacy/SnapshotScaffoldingProvider.php b/_legacy/SnapshotScaffoldingProvider.php index 80b6455..b7a1c8c 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(ReadOneLegacyResolver::class)) { return; } @@ -46,6 +49,7 @@ public function provideGraphQLScaffolding(SchemaScaffolder $scaffolder) ->addFields($fields) ->operation(SchemaScaffolder::READ_ONE) ->addArg('filter', 'IDFilterType!') + ->setResolver([ReadOneLegacyResolver::class, 'resolve']) ->end() ->operation('rollback'); }