apologies for the double post but I'm getting some...
# community-help
j
apologies for the double post but I'm getting some weirdness when attempting to use the JS SDK with the new
union
federated search feature. the parameter seems to just get ignored, even on the master branch (though it's working through postman). has anyone else managed to get it working through the SDK? i've made an issue but just in case I'm missing something obvious...
j
CC: @Fanis Tharropoulos
f
I'll investigate and report back
j
Thanks guys
f
Could you check out this PR: https://github.com/typesense/typesense-js/pull/266 We didn't pass the actual object into the request. Also took some time to provide better type inference for return types
j
Thanks @Fanis Tharropoulos I'll have a play with that. Sorry I can't get it to build locally for some reason so I'll wait until the compiled version gets merged in. On a loosely related note, I don't suppose there is any way to attach a listener to Typesense.client so that I can log the raw queries/data that are getting passed to the typesense API, is there? I'm just thinking that it would be a useful feature to help me troubleshoot this kind of thing in future.
j
Just pushed the build artifacts to
master
, could you try now?
j
Yep that's working a treat now 👍 Thanks again for taking care of that so quickly, we're delighted to be able to use it in our project as it significantly simplifies our API.
👍 2
f
On a loosely related note, I don't suppose there is any way to attach a listener to Typesense.client so that I can log the raw queries/data that are getting passed to the typesense API, is there? I'm just thinking that it would be a useful feature to help me troubleshoot this kind of thing in future.
AFAIK, you could use an axios global interceptor to catch any outgoing request to Typesense and use that. The debug logger also logs out the requests (albeit without the body contents, just responses and endpoints) if you want a quicker look. We intend to update the library to let you pass an axios instance on Client instantiation to give you more control for Axios
🙌 1