Skip to content

Commit

Permalink
Update readone resolver to match legacy resolver in CMS page (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
satrun77 authored Oct 21, 2021
1 parent 0e9d378 commit 616d076
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _legacy/SnapshotScaffoldingProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

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\SchemaScaffolder;
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Member;

if (!interface_exists(ScaffoldingProvider::class)) {
if (!interface_exists(ScaffoldingProvider::class) || !class_exists(ReadOneLegacyResolver::class)) {
return;
}

Expand Down Expand Up @@ -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');
}
Expand Down

0 comments on commit 616d076

Please sign in to comment.