diff --git a/src/GraphQL/Types/Input/IntegerRangeStringType.php b/src/GraphQL/Types/Input/IntegerRangeStringType.php deleted file mode 100644 index dc2b970..0000000 --- a/src/GraphQL/Types/Input/IntegerRangeStringType.php +++ /dev/null @@ -1,77 +0,0 @@ - __('enjin-platform-beam::type.integer_range.description')]); - } - - /** - * Serializes an internal value to include in a response. - */ - public function serialize($value): string - { - $result = $this->serializeValue($value); - - if (count($result) > 1) { - throw new Error(__('enjin-platform::error.not_valid_integer_range')); - } - - return $result[0]; - } - - /** - * Parses an externally provided value (query variable) to use as an input. - */ - public function parseValue($value): string - { - if (! is_string($value) || ! $this->isValid($value)) { - throw new Error(__('enjin-platform::error.cannot_represent_integer_range', ['value' => Utils::printSafeJson($value)])); - } - - return $value; - } - - /** - * Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input. - */ - public function parseLiteral($valueNode, ?array $variables = null): string - { - if (! in_array($valueNode->kind, ['StringValue']) || ! $this->isValid($valueNode->value)) { - throw new Error(__('enjin-platform::error.not_valid_integer_range'), [$valueNode]); - } - - return $valueNode->value; - } - - /** - * Validate is the right format to expand into ranges. - */ - public function isValid($value): bool - { - return ! $this->validateValue($value); - } - - /** - * Self instance. - */ - public function toType(): Type - { - return new static(); - } -}