Hi there!
After days of debugging I just cannot figure out why my query is not working. This is the setup:
Scheme
type Chat {
chat_id: Int! @id
messages: [Message] @hasInverse(field: chat)
title: String @search(by: [term, fulltext])
}
type Message {
chat: Chat!
message: String! @search(by: [term, fulltext])
message_id: Int! @id
timestamp: DateTime!
user: User!
}
type User {
messages: [Message] @hasInverse(field: user)
user_id: Int! @id
username: String
}
Query
query getChat($x: Int!) {
getChat (chat_id: $x) {
chat_id
title
messages { message }
}
}
Variables
{"x": 1173233405}
Error
couldn’t rewrite query getChat because Argument (chat_id) of getChat was not able to be parsed as a string
Putting the chat_id
directly into the query does work:
query getChatQuery {
getChat(chat_id: 1173233405) {
chat_id
title
messages { message }
}
}
But separating the query and variables does not. Does anybody have any clue what I’m doing wrong?