I have an enum in a schema like this:
enum Classification {
A
B
C
D
}
And the following query:
type Query {
listClasification: Clasification
}
Ant the resolver on the JS code is the following:
const classification = {
A: 'A',
B: 'B',
C: 'C',
D: 'D'
};
const resolvers = {
Query: {
listClasification: () => {return classification}
},
};
But when I execute the following query:
{
listClasification
}
I got the following error:
"message": "Enum "Classification" cannot represent value: { A: "A", B: "B", C: "C", D: "D" }",
Then, how can solve this error, and return all classifications in a query?
Thanks