Dgraph Version: v20.07.1
I had a problem when I try to search enum. I follow the graphql doc to learn graphql, and I make a schema like this:
enum Tag {
GraphQL
Database
Question
}
type Review {
id: ID!
tags: [Tag!]! @search
}
Than I run a mutation:
mutation{
addReview(input:[{tags:[Question]}]) {
review {
tags
}
}
}
The query:
query {
queryReview(filter: { tags: { eq: Question } } ) {
tags
}
}
But I get error bellow:
{
"errors": [
{
"message": "Value provided Question is incompatible with expected type [Tag!]!",
"locations": [
{
"line": 2,
"column": 39
}
]
}
]
}
Then I try:
query {
queryReview(filter: { tags: { eq: [Question] } } ) {
tags
}
}
I got the right result!
But the doc tells me to query like this:
query {
queryPost(filter: { tags: { eq: GraphQL } } ) { ... }
}
Is the doc wrong?