Skip to content

DateScalarType, DateTimeScalarType.php and JsonScalarType.php mistake? #1

Description

@fvromera

Hi,

Sorry, because I'm new in github and I don't know how to use it well, I create an issue in other repository, but the issue is with it. Somebody can delete the other issue?
Hi,

I recently installed your phalcon-graphql-boilterplate to test Phalcon and GraphQL worlds, because them looks very powerful and the best options in their sectors.

Testing your project, when I try to introduce date/datetime fields I have a problem, I get all the time errors like: "date is expected, '2017-10-27' found', but this format is correct.

So, when I verify this format in their classes and found it on redound/phalcon-graphql project, inside the folder src/PhalconGraphQL/Definition/ScalarTypes/, maybe I'm wrong, but when I modified these files it works (because not found StringValue y IntValue in GraphQL\Language\AST):

  1. Changes in JsonScalarType.php

remove: use GraphQL\Language\AST\StringValue;
add: use GraphQL\Language\AST\StringValueNode;

remove: if ($ast instanceof StringValue) {
add: if ($ast instanceof StringValueNode) {

  1. Changes in DateTimeScalarType.php

remove: use GraphQL\Language\AST\IntValue;
add: use GraphQL\Language\AST\IntValueNode;
remove: use GraphQL\Language\AST\StringValue;
add: use GraphQL\Language\AST\StringValueNode;

  1. Changes in DateScalarType.php

remove: use GraphQL\Language\AST\IntValue;
add: use GraphQL\Language\AST\IntValueNode;
remove: use GraphQL\Language\AST\StringValue;
add: use GraphQL\Language\AST\StringValueNode;

remove: if ($ast instanceof StringValue || $ast instanceof IntValue) {
add: if ($ast instanceof StringValueNode || $ast instanceof IntValueNode) {

I hope this help a little bit your project :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions