1- import { jsonToGraphQLQuery } from "json-to-graphql-query" ;
21import { defineStore } from "pinia" ;
32import GraphClient from "@/lib/GraphClient/GraphClient.js" ;
43import advancedQuery from "@/lib/GraphClient/queries/getAdvancedSearch.json" ;
@@ -23,25 +22,29 @@ export const useAdvancedSearchStore = defineStore("advancedSearch", {
2322 this . fairassistID ,
2423 filterSelected ,
2524 ) ;
26- let whereObjData = {
27- operator : "_and" ,
28- fields : [ ] ,
29- } ;
30- //Below is the format required for jsonToGraphQlQuery
31- let parentQuery = { } ;
32- parentQuery [ "query" ] = { } ;
33- parentQuery [ "__args" ] = whereObjData ;
34- parentQuery . query [ "__args" ] = {
35- where : whereObjData ,
36- } ;
37- let graphqlQuery = jsonToGraphQLQuery ( parentQuery , { pretty : true } ) ;
38- graphqlQuery = graphqlQuery . replace ( "query" , "" ) . trim ( ) ;
39- graphqlQuery = graphqlQuery . match ( / ^ \( ( .* ) \) $ / ) [ 1 ] ;
25+ // let whereObjData = {
26+ // operator: "_and",
27+ // fields: [],
28+ // };
29+ //
30+ // //Below is the format required for jsonToGraphQlQuery
31+ // let parentQuery = {};
32+ // parentQuery["query"] = {};
33+ // parentQuery["__args"] = whereObjData;
34+ // parentQuery.query["__args"] = {
35+ // where: whereObjData,
36+ // };
37+ // let graphqlQuery = jsonToGraphQLQuery(parentQuery, { pretty: true });
38+ //
39+ // graphqlQuery = graphqlQuery.replace("query", "").trim();
40+ // graphqlQuery = graphqlQuery.match(/^\((.*)\)$/)[1];
41+ //
42+ // let whereObj = graphqlQuery.replace("where:", "");
4043
41- let whereObj = graphqlQuery . replace ( "where:" , "" ) ;
44+ let whereObJQuery = '{operator: "_and", fields: []}' ;
4245 ADVANCED_TAGS . queryParam = {
4346 id : searchIds ,
44- where : whereObj ,
47+ where : whereObJQuery ,
4548 } ;
4649 try {
4750 let response = await CLIENT . executeQuery ( ADVANCED_TAGS ) ;
0 commit comments