Search Components Query is not returning proper results. We have 1249 components on compass while viewing on the UI , But when we use this GQL to query and get all components from compass , using end cursor. The end cursor is not null even though the component limit is achieved . The data is duplicate in the query response. It returns random count of data.
Is there any alternative approach to get proper count & results.
Query : GraphQL API
Hello @Priya Ghosh ,
Sharing the script you are using to paginate through the search results would greatly help with the issue troubleshooting (but please don't share any auth credentials like emails/API tokens).
>> The data is duplicate in the query response.
Are you passing any sorting parameters? When no sorting parameters are passed, then search falls back to sorting by relevancy that can change while paging through since relevancy is not fully deterministic. FWIW here is an example search request with explicitly specified sort order:
const requestBody = {
variables: {
cloudId: CLOUD_ID,
query: {
first: 100,
"sort": [
{
"name": "title",
"order": "ASC"
}
],
},
},
query: SEARCH_QUERY,
};
I hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.