field = $field; $this->parentType = $parentType; $this->relatedType = $relatedType; if (!$parentType && !$relatedType) { throw new Error("No parentType and relatedType."); } } public function getField(): string { return $this->field; } public function getParentType(): ?string { return $this->parentType; } public function getRelatedType(): ?string { return $this->relatedType; } }