Graphqlbundle: Use custom scalar DateTime

Created on 22 Feb 2017  路  4Comments  路  Source: overblog/GraphQLBundle

| Q | A
| ---------------- | -----
| Bug report? | no
| Feature request? | no
| BC Break report? | no
| RFC? | no
| Version/Branch | 0.7.1

Hello,

How to define custom scalar type ?
We followed the example in test suite but in place of the date time in query response, we get this:

    ...
    startDateTime: ["Acme\\AppBundle\\GraphQL\\Type\\DateTimeType", "serialize"]
    ...

If we send parameters for a mutation, the datetime in database is null.

Did we miss something ?

question

All 4 comments

Hi @VincentClair,
the method Acme\AppBundle\GraphQL\Type\DateTimeType::serialize is callable ?

Thank you for your quick reply.
And sorry, we missed the good namespace !!
We get the good value now for query.

If the serialize is not found, could the service send an error in place of the actual serialize definition ["Acme\\AppBundle\\GraphQL\\Type\\DateTimeType", "serialize"] ?

yes must work on this, missing error to help developers debugging...

@VincentClair

If you mean throwing an exception when ["Acme\\AppBundle\\GraphQL\\Type\\DateTimeType", "serialize"] is not callable, then it's implemented in 1.0 and this issue can be closed.

@mcg-web ping

Was this page helpful?
0 / 5 - 0 ratings