Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn\’t rewrite query because Argument () of * was not able to be parsed as a string #8134

Closed
HugooB opened this issue Jun 9, 2022 · 5 comments
Labels
area/graphql Issues related to GraphQL support on Dgraph. community Issue or PR created by the community. investigate Requires further investigation kind/bug Something is broken. Stale

Comments

@HugooB
Copy link

HugooB commented Jun 9, 2022

Hi there!

After days of debugging I just cannot figure out why my query is not working. This is the setup running Dgraph v21.12.0:

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?

After reading through the documentation I noticed that @id declarations can only be assigned to Strings types, as stated in the docs. However, the Dgraph v21.03.0 release notes state the following:

  • Fix(GraphQL): adding support for @id with type other than strings (#7019)

So, it this a bug? @akon-dey encouraged me to file this Github issue, more info here:
https://discuss.dgraph.io/t/couldn-t-rewrite-query-because-argument-of-was-not-able-to-be-parsed-as-a-string/17376/2

@MichelDiz MichelDiz added kind/bug Something is broken. investigate Requires further investigation area/graphql Issues related to GraphQL support on Dgraph. labels Jul 26, 2022
@IDerr
Copy link

IDerr commented Jan 26, 2023

I am having the same exact issue for this, did you managed to fix it ?

@MichelDiz
Copy link
Contributor

There's no fix until we process the cherry pick of #7019

@IDerr
Copy link

IDerr commented Jan 26, 2023

Perfect, thanks for the quick answer

@IDerr
Copy link

IDerr commented Feb 2, 2023

Is there any release planned for the cherry pick ? I just saw it was pushed 2y ago,

@MichelDiz MichelDiz added the community Issue or PR created by the community. label Mar 7, 2023
Copy link

github-actions bot commented Aug 1, 2024

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

@github-actions github-actions bot added the Stale label Aug 1, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph. community Issue or PR created by the community. investigate Requires further investigation kind/bug Something is broken. Stale
Development

No branches or pull requests

3 participants