diff --git a/src/DataObjectInterfaceTypeCreator.php b/src/DataObjectInterfaceTypeCreator.php new file mode 100644 index 000000000..26c49e2ae --- /dev/null +++ b/src/DataObjectInterfaceTypeCreator.php @@ -0,0 +1,48 @@ + 'DataObject', + 'description' => 'Base Interface', + ]; + } + + public function fields() { + return [ + 'id' => [ + 'type' => Type::nonNull(Type::int()), + ], + 'created' => [ + 'type' => Type::string(), + ], + 'lastEdited' => [ + 'type' => Type::string(), + ], + + ]; + } + + public function resolveType($object) + { + $type = null; + + if($fqnType = $this->manager->getType(get_class($object))) { + $type = $fqnType; + } + + if($baseType = $this->manager->getType(get_class($object))) { + $type = $baseType; + } + + return $type; + } + +}