Closed shawnhind closed 4 years ago
I've updated the documentation, could you check whether that works for you?
@LaurensRietveld thanks for the response.
I just tried copying the updated line from the docs:
const yasgui = new Yasgui(document.getElementById("yasgui"), {
requestOpts: { endpoint: "http://example.com/sparql" },
copyEndpointOnNewTab: false
});
I emptied local storage, did an empty cache and hard refresh and it's still querying dbpedia rather than example.com/sparql.
@shawnhind Was hoping you were a bit slower as I pushed another commit fixing a typo. The snippet should be:
const yasgui = new Yasgui(document.getElementById("yasgui"), {
requestConfig: { endpoint: "http://example.com/sparql" },
copyEndpointOnNewTab: false
});
Could you try that one?
@LaurensRietveld that works now. Thanks a lot for responding so quickly. Would you be able to clarify if the requestConfig object is also where I should set my headers?
Yes, that's correct. I've added a bit more documentation about the request configuration
Awesome, thanks again!
@LaurensRietveld how would I go about changing headers after initialization?
yasgui.config.requestConfig.headers = {
"X-CSRF-TOKEN": "somevalue",
"X-ACCOUNT-ID": "othervalue"
}
This does change the headers in the object but then when the request is sent the server is still receiving the initial headers. Is there a setter method I need to call to have it propagate properly?
I'm trying to update our YASGUI to use the new mono repo instead of the separate components. I'm following the instructions on your documentation page at: https://triply.cc/docs/yasgui-api#yasgui-config but I think I must be missing a step or misunderstanding.
The problem is that even when using the yasgui initialization line you gave as an example it still queries dbpedia rather than example.com/sparql.
Here's the initialization line that I'm trying from the docs:
However after clicking the query button in yasqe this is still querying dbpedia rather than example.com/sparql.
And here's the config object of YASGUI after initialization: