silverstripe-cms/code/GraphQL/Resolver.php
Aaron Carlino 5ab1ff3e69
NEW: GraphQL Compatibility (#2607)
* Add GraphQL4 compatibility

* Add getPageByLink

* Blacklist sitetree fields

* Remove getByLink from default schema. use linkable plugin

* getByLink compatability with new readOne filter anything

* Remove return type

* Compliance with new modelConfig

* Prep for travis

* Improvements for versioned-admin compat

* BC class guards

* New graphql 3 compat

* Fix travis syntax error

* New backward graphqlphp dependency

* Lint, build

* New phpcs exclusion

* Tidy up travis

* Fix rollback mutation

* Update code/GraphQL/_legacy/ReadOneResolver.php

Co-authored-by: Ingo Schommer <ingo@silverstripe.com>

* Address ingo feedback

* Deprecated GraphQL v3 classes

* Remove deleted branches

Co-authored-by: Ingo Schommer <ingo@silverstripe.com>
Co-authored-by: Ingo Schommer <me@chillu.com>
2020-11-13 13:50:44 +13:00

20 lines
405 B
PHP

<?php
namespace SilverStripe\CMS\GraphQL;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\GraphQL\Schema\Resolver\DefaultResolverProvider;
if (!class_exists(DefaultResolverProvider::class)) {
return;
}
class Resolver extends DefaultResolverProvider
{
public static function resolveGetPageByLink($obj, array $args = [])
{
return SiteTree::get_by_link($args['link']);
}
}