i'm currently working on an ecommerce project, and start to implement graphql ruby with my solidus, now i'm about to build on faceted search using solidus searchkick
there is a custom function provided by solidus_searchkick
searcher = build_searcher(params.merge(fields: fields))
@products = searcher.retrieve_products
my idea was to pass the params to graphql query and perform the search while return the products list
query facetQuery($params: String){
viewer {
facetProduct(params: $params){ ... }
}
}
However if i put
connection :facetProduct, Types::ProductType.connection_type do
resolve -> (obj, args, context) {
searcher = build_searcher(params)
searcher.retrieve_products
}
end
i got a problem build_search is not defined, is there a way to integrate this function directly to graphql, currently i solved this problem over api, via httparty which is not very elegant solution