Enums are defined though the EnumType class, in line with the conclusion on issue #2. Here's the example from the README:
const query = {
query: {
Posts: {
__args: {
orderBy: 'post_date',
status: new EnumType('PUBLISHED')
},
title: true,
body: true
}
}
};
However, this is problematic when I need to actually store this in a JSON file, where the EnumType won't be available. Here's a suggestion for an alternative way to define an enum:
{
"query": {
"Posts": {
"__args": {
"orderBy": "post_date",
"status": { "__enum": "PUBLISHED" }
},
"title": true,
"body": true
}
}
}
Would you be interested in a PR that implements this as an alternative to the EnumType, @vkolgi?
Enums are defined though the
EnumTypeclass, in line with the conclusion on issue #2. Here's the example from the README:However, this is problematic when I need to actually store this in a JSON file, where the
EnumTypewon't be available. Here's a suggestion for an alternative way to define an enum:{ "query": { "Posts": { "__args": { "orderBy": "post_date", "status": { "__enum": "PUBLISHED" } }, "title": true, "body": true } } }Would you be interested in a PR that implements this as an alternative to the
EnumType, @vkolgi?