public function testMethods() { $global = Node::toGlobalId('user', 1); $fromGlobal = Node::fromGlobalId($global); $this->assertEquals('user', $fromGlobal[0]); $this->assertEquals(1, $fromGlobal[1]); $this->assertEquals([null, null], Node::fromGlobalId(null)); }
public function resolve($value, array $args, ResolveInfo $info) { list($type, $id) = Node::fromGlobalId($args['id']); return $this->fetcher->resolveNode($type, $id); }
/** * @inheritdoc */ public function resolve($value, array $args, ResolveInfo $info) { return $value ? Node::toGlobalId($this->typeName, $value['id']) : null; }