NEW: Compliance with new SchemaConfig API (#2617)

This commit is contained in:
Aaron Carlino 2020-12-01 21:27:16 +13:00 committed by GitHub
parent 2ad7c609d5
commit 7b960c1537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 38 deletions

View File

@ -3,13 +3,6 @@ Name: cms-graphql
Only: Only:
classexists: 'SilverStripe\GraphQL\Schema\Schema' classexists: 'SilverStripe\GraphQL\Schema\Schema'
--- ---
SilverStripe\Core\Injector\Injector:
SilverStripe\GraphQL\Schema\Registry\ResolverRegistry:
constructor:
cmsResolver: '%$SilverStripe\CMS\GraphQL\Resolver'
SilverStripe\GraphQL\Schema\Registry\PluginRegistry:
constructor:
linkable: '%$SilverStripe\CMS\GraphQL\LinkablePlugin'
SilverStripe\CMS\Model\SiteTree: SilverStripe\CMS\Model\SiteTree:
graphql_blacklisted_fields: graphql_blacklisted_fields:
HasBrokenFile: true HasBrokenFile: true
@ -20,28 +13,5 @@ SilverStripe\CMS\Model\SiteTree:
SilverStripe\GraphQL\Schema\Schema: SilverStripe\GraphQL\Schema\Schema:
schemas: schemas:
admin: admin:
models: src:
Page: - 'silverstripe/cms: _graphql'
fields:
id: true
lastEdited: true
absoluteLink:
type: String
operations:
copyToStage: true
rollback: true
readOne: true
SilverStripe\Security\Member:
fields:
id: true
firstName: true
surname: true
operations:
readOne: true
modelConfig:
DataObject:
operations:
read:
plugins:
getByLink:
after: filter

9
_graphql/config.yml Normal file
View File

@ -0,0 +1,9 @@
resolvers:
- 'SilverStripe\CMS\GraphQL\Resolver'
modelConfig:
DataObject:
operations:
read:
plugins:
getByLink:
after: filter

17
_graphql/models.yml Normal file
View File

@ -0,0 +1,17 @@
Page:
fields:
id: true
lastEdited: true
absoluteLink:
type: String
operations:
copyToStage: true
rollback: true
readOne: true
SilverStripe\Security\Member:
fields:
id: true
firstName: true
surname: true
operations:
readOne: true

View File

@ -4,13 +4,8 @@
namespace SilverStripe\CMS\GraphQL; namespace SilverStripe\CMS\GraphQL;
use SilverStripe\CMS\Model\SiteTree; use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\GraphQL\Schema\Resolver\DefaultResolverProvider;
if (!class_exists(DefaultResolverProvider::class)) { class Resolver
return;
}
class Resolver extends DefaultResolverProvider
{ {
public static function resolveGetPageByLink($obj, array $args = []) public static function resolveGetPageByLink($obj, array $args = [])
{ {