public function resolveNodeType($object) { if ($object instanceof User) { return Types::user(); } else { if ($object instanceof Image) { return Types::image(); } else { if ($object instanceof Story) { return Types::story(); } } } }