I want to create this as end result: {"customerName: {"contains": "bri"}}
, but I keep getting the name of the variable written instead. I've tried a multitude of things and just can't get it to go as I want. Hoping this is simple and I'm just completely overlooking it.
interface IGraphQLFilterVariable {
[key: string]: [key: string] | any | IGraphQLFilterVariable[]
}
let property = "customerName";
let type = "contains";
let filter = "bri";
let singleFilter: IGraphQLFilterVariable = {};
singleFilter[property] = {
type: filter
};
console.log(singleFilter);