edgeType = new EdgeType($ownerType, $nodeType, $pivotType); $this->connectionType = new ConnectionType($this->edgeType); GraphQL::addType($this->connectionType, $this->connectionType->getName()); parent::__construct(new $nodeType, $relationName); } /** * Get the edge type of the belongs to many relationship. */ public function getEdgeType(): EdgeType { return $this->edgeType; } public function type(): Type { return Type::nonNull(GraphQL::type($this->connectionType->getName())); } /** * The pagination type if applicable. */ public function paginationType(): PaginationType { return PaginationType::CONNECTION; } }