name = $name; $this->type = $isList ? $itemType : $type; $this->baseType = $baseType; $this->description = $description; $this->required = $required; $this->isList = $isList; $this->itemsRequired = $itemsRequired; $this->defaultValue = $defaultValue; } /** * Get the name of the argument. * * @return string */ public function getName() : string { return $this->name; } /** * Get the argument type's configured name * * @return string */ public function getTypeName() : string { return $this->type; } /** * Get the argument's base type. This can be used to inherit fields for a filter or sort input, etc. * * @return string */ public function getBaseType() : string { return $this->baseType; } /** * Return true if argument is a list of input items, otherwise false if it is a single object/scalar. * * @return bool */ public function isList() : bool { return $this->isList; } /** * Return true if argument is required when invoking the query where the argument is specified. False otherwise. * * @return bool */ public function isRequired() : bool { return $this->required; } /** * Return true if item is a list, and if that list must be populated by at least one item. False otherwise. * * @return bool */ public function areItemsRequired() : bool { return $this->itemsRequired; } /** * Return the human-readable description of the argument containing it's documentation. * * @return string */ public function getDescription() : string { return $this->description; } /** * Return defaultValue if argument is a scalar and has a configured defaultValue. Otherwise return an empty string. * * @return string|null */ public function getDefaultValue() : ?string { return $this->defaultValue; } /** * Return true if defaultValue is set, otherwise false * * @return bool */ public function hasDefaultValue() : bool { return $this->defaultValue ? true: false; } }