Has anyone encountered an issue with Lacinia where query variables which are lists fail to parse?
In particular, if there’s an InputObject that has a field which is a list, I cannot pass that value down as a query variable:
# this works
query WorkingQuery($search: [EDN_Filter]) {
searchPosts(search: $search) {
totalCount
nodes {
title
}
}
}
But this doesn’t:
mutation ChangeStatus($filters: [EDN_Filter], $status_id: ID!) {
changeStatus(
statusId: $status_id,
postSelection: {
filters: $filters
selection: {without_ids: []}
} ) {
title
}
}
I get this error:
{
"errors": [
{
"message": "Exception applying arguments to field `changeStatus': For argument `postSelection', unknown argument `selection'.",
"locations": [
{
"line": 48,
"column": 3
}
],
"extensions": {
"field": "__Mutations/changeStatus",
"argument": "__Mutations/changeStatus.postSelection",
"defined-arguments": null
}
}
]
}
(changed from the actual schema for terseness and clarity)I have seen this before yeah, does it help to change the argument to be (whaver type is) a postSelection
? As an intermediate workaround ^^
Yeah it’s what I do. I’m not sure if this is Lacinia related or part of the spec.
I'm not sure variables inside input objects work.
It's on my mental list of things to fix before a 1.0 release.
Would it help if I open an issue?
(It’s not a huge deal as there’s always a workaround)