From 4eeb13ea1ab011596b1d1e0da1aaeff5127c1f94 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_legacy/SnapshotScaffoldingProvider.php b/_legacy/SnapshotScaffoldingProvider.php index 80b6455..8ed9be1 100644 --- a/_legacy/SnapshotScaffoldingProvider.php +++ b/_legacy/SnapshotScaffoldingProvider.php @@ -3,6 +3,7 @@ namespace SilverStripe\SnapshotAdmin; +use SilverStripe\Admin\GraphQL\ReadOneLegacyResolver; use SilverStripe\CMS\Model\SiteTree; use SilverStripe\Core\ClassInfo; use SilverStripe\GraphQL\Scaffolding\Interfaces\ScaffoldingProvider; @@ -10,7 +11,7 @@ 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 +47,7 @@ public function provideGraphQLScaffolding(SchemaScaffolder $scaffolder) ->addFields($fields) ->operation(SchemaScaffolder::READ_ONE) ->addArg('filter', 'IDFilterType!') + ->setResolver(new ReadOneLegacyResolver($inst)) ->end() ->operation('rollback'); }