Skip to content

Conversation

solocommand
Copy link
Member

When passing a literal value for a date (rather than a defined variable definition), the value is not properly transformed into a Date.

Assuming the following pseudo setup:

scalar Date
query {
  isDate(date: Date!): String
}
const { DateType } = require('@limit0/graphql-custom-types');
const resolvers = {
  Date: DateType,
  test: (_, { date }) => typeof date,
};

Currently works:

query IsDate($date: Date!) {
  isDate(date: $date)
}
{ date: 1664427600000 }

Should work but does not

query {
  isDate(date: 1664427600000)
}

@solocommand solocommand merged commit bfa4ca0 into limit-zero:master Nov 1, 2022
@solocommand solocommand deleted the date-parsing branch November 1, 2022 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant