name = $name; $this->type = $isList ? $itemType : $type; $this->required = $required; $this->isList = $isList; $this->resolver = $resolver; $this->description = $description; $this->arguments = $arguments; } /** * Get the field name. * * @return string */ public function getName() : string { return $this->name; } /** * Get the type's configured name. * * @return string */ public function getTypeName() : string { return $this->type; } /** * Return true if field is a list of items. False otherwise. * * @return bool */ public function isList() : bool { return $this->isList; } /** * Return true if the field is required by an input type to be populated. False otherwise. * * @return bool */ public function isRequired() : bool { return $this->required; } /** * Get the resolver for a given field. If no resolver is specified, return an empty string. * * @return string */ public function getResolver() : string { return $this->resolver; } /** * Get the list of arguments configured for the field. Return an empty array if no arguments are configured. * * @return Argument[] */ public function getArguments() : array { return $this->arguments; } /** * Return the human-readable description of the field. * * @return string|null */ public function getDescription() : string { return $this->description; } }