Source of file ObjectType.php
Size: 0,857 Bytes - Last Modified: 2021-12-24T06:44:48+00:00
/var/www/docs.ssmods.com/process/src/_legacy/Types/ObjectType.php
123456789101112131415161718192021222324252627282930313233 | <?php namespace DNADesign\Elemental\GraphQL\Types; use GraphQL\Type\Definition\CustomScalarType; use SilverStripe\GraphQL\TypeCreator; if (!class_exists(TypeCreator::class)) { return; } /** * Creates a "scalar" type that is a single dimension object - represented as an associative array on the PHP side. * * @deprecated 4.8..5.0 Use silverstripe/graphql:^4 functionality. */ class ObjectType extends TypeCreator { public function toType() { return new CustomScalarType([ 'name' => 'ObjectType', 'serialize' => function ($value) { return (object) $value; }, 'parseValue' => function ($value) { return (array) $value; }, 'parseLiteral' => function ($ast) { return $ast->value; }, ]); } } |