neo4j-graphql-js icon indicating copy to clipboard operation
neo4j-graphql-js copied to clipboard

[BUG] Error when using required for DateTime on mutations

Open Crodaycat opened this issue 4 years ago • 1 comments

Hello, the parse of required DateTime in mutations doesn't work like when it's not required, when i do this:

type Mutation {
  CreateMessage(
    id: String = ""
    text: String!
    sentAt: DateTime!
    senderId: String!
    chatId: String!
  ): Message!
}

I get this error:

Error: The type of Mutation.CreateMessage(sentAt:) must be Input Type but got: _Neo4jDateTime!.

But when i use it as optional the schema compiles and replaces it succesfully with _Neo4jDateTimeInput (Optional). Like this:

type Mutation {
  CreateMessage(
    id: String = ""
    text: String!
    sentAt: DateTime
    senderId: String!
    chatId: String!
  ): Message!
}

We are using:

  • apollo-server: 2.6.4
  • neo4j-driver: 1.7.4
  • neo4j-graphql-js: 2.6.3

Crodaycat avatar Jul 07 '19 18:07 Crodaycat

https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608

michaeldgraham avatar May 02 '21 04:05 michaeldgraham