Hello i have query variable like this
{
"tagFilter": [
{
"value": "ctf:ring"
}
]
}
and i want to copy url /graphql/execute.json/testingtemplate/collections;tagFilter=[{value: ctf:ring}]
and this encode
graphql/execute.json/testingtemplate/collections%3BtagFilter=[%7Bvalue:%20ctf:ring%7D]
and i get error this. how to create url if variable array of object?
Views
Replies
Total Likes
Hi,
You need to encode entire query parameters ensuring special characters are encoded correctly, like below
const query = {
tagFilter: [
{
value: "ctf:ring"
}
]
};
const encodedQuery = encodeURIComponent(JSON.stringify(query));
const url = `/graphql/execute.json/testingtemplate/collections;tagFilter=${encodedQuery}`;
console.log(url);
// Output: /graphql/execute.json/testingtemplate/collections;tagFilter=%5B%7B%22value%22%3A%22ctf%3Aring%22%7D%5D
yes but it's still error.
i have try url like this but cannot /graphql/execute.json/testingtemplate/collections;tagFilter=%5B%7B%22value%22%3A%22ctf%3Aring%22%7D%5D
Please check this https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/headless/graphql...
Something like this might work.
/graphql/execute.json/testingtemplate/collections%3BtagFilter%3D[%7B"value":"ctf:ring"%7D]
This is not work too. i'm confused
Hi @VinceLu
I checked the implementation of StringArrayFilterExpression and tried some samples.
Could you please try this :
/graphql/execute.json/testingtemplate/collections%3BtagFilter=%7B"values":["collection:ring/bracelet","collection:ring/earing"]%7D
For passing a single value, it will have to be passed as value instead of values
/graphql/execute.json/testingtemplate/collections%3BtagFilter=%7B"value":"collection:ring/earing"%7D
I believe this should work and hope this helps.
Hii thanks for help me.
/graphql/execute.json/CTF-MOBILE/ProductList%tagname=%7B"values":["collection:ring/ring"]%7D
this is work for single value , but for multiple i'm still confused. i have no item if have 2 value
/graphql/execute.json/CTF-MOBILE/ProductList%tagname=%7B"values":["collection:ring/ring", "collection:ring/earing"]%7D
i don't know why if i put 2 items i can't get the item. just return empty
in the playground i can get item
can you help me for multiple value?
not work.
and i have encode too but not working for array
i found thread sama issue with me. https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/graphql-variable-type-mism.... and still not found the solutions. anyone please helpme
Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Still not found solution
Views
Likes
Replies