shurcooL/graphql

Expecting type ISODateTime

Chillance opened this issue · 2 comments

So, I'm getting this error message about this ISODateTime type being expected, but I can't see that in this library. How do I fix this?

Thanks!

Is that a custom scalar type that the GraphQL server you're connecting to defines in its schema?

If so, you'll need to define your own Go type accordingly.

See here for an example of a DateTime Go type that was created for GitHub's DateTime GraphQL scalar.

As @dmitshur suggested you can create your own type:

type ( ISODateTime struct{ time.Time } )

Than use it in your Query/Mutation/Variables.