public function getField($name) { if (null === $this->fields) { $this->getFields(); } Utils::invariant(isset($this->fields[$name]), "Field '%s' is not defined for type '%s'", $name, $this->name); return $this->fields[$name]; }