You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like the ability to define a filter that always evaluates to true. This way I can dynamically construct the filter on the client dependent on the inputs to my query.
I want to write a function that can load pins based on a provided tag or all pins if no tag is provided.
I currently need to implement this function this way, which create lots of duplication of the query string.
asyncfunctionloadPins(tag){letpins={};if(tag!==undefined){constinput={where: {tag: {equalTo: tag}}};awaitcompose.executeQuery(` query($input: PinFiltersInput) { pinIndex(first:100, filters: $input) { edges { node { id name description tag lat lon author { id } } } } }`,{ input });}else{pins=awaitcompose.executeQuery(` query() { pinIndex(first:100) { edges { node { id name description tag lat lon author { id } } } } }`);}returnpins}
Instead I would prefer to implement the function in this way:
asyncfunctionloadPins(tag){letinput={};if(tag!==undefined){input={where: {tag: {equalTo: tag}}}};constpins=awaitcompose.executeQuery(` query($input: PinFiltersInput) { pinIndex(first:100, filters: $input) { edges { node { id name description tag lat lon author { id } } } } }`,{ input });returnpins}
However the second function gets error about the input value not being a valid PinFiltersInput object. I would be fine with an explicit value like {where: "true" } instead of just the empty object {}. Anything that makes it so its possible to define a filter that is always true.
The text was updated successfully, but these errors were encountered:
I am pretty sure I tried that and it didn't work, but maybe I was sending null ? I was able to figure out a solution using in and an empty list, which worked better for my use case as I needed to use the in operator in either case.
Description
I would like the ability to define a filter that always evaluates to true. This way I can dynamically construct the filter on the client dependent on the inputs to my query.
Technical Information
Given a model like:
I want to write a function that can load pins based on a provided tag or all pins if no tag is provided.
I currently need to implement this function this way, which create lots of duplication of the query string.
Instead I would prefer to implement the function in this way:
However the second function gets error about the input value not being a valid PinFiltersInput object. I would be fine with an explicit value like
{where: "true" }
instead of just the empty object{}
. Anything that makes it so its possible to define a filter that is always true.The text was updated successfully, but these errors were encountered: