public function getField(string $name): FieldInterface
    {
        if (!$this->hasField($name)) {
            throw new DefinitionException("Field '$name' is not defined.");
        }

        return $this->fields[$name];
    }