Skip to content

postgresql float8 is handle by Scalar_converter and return excetion #59

Description

@rccc

Hello,

I hope i will not waste time of anyone. I do not think it is a bug, i think i missed something in my side.

I noticed that the fields defined as float8 in postgres are handle by ScalarConverter, and then ScalarConverter return exception as my value is float/decimal but not string.

Just to realize what happens i modify ScalaConverter like this:

    public function fromGraphQL($value): string
    {
        if (! is_string($value) && (!is_float($value)) ) {
            $value = (string) $value;
            // throw new \InvalidArgumentException('Expected string, got ' . gettype($value));
        }

        return $value;
    }

And then it is ok, (value in this case is 100, not 100.00).

Many thanks in advance for reading.

Eric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions