Hi,
Our next app will make use of Shopify QL. However I realize that there is no way in Polaris to access the Shopify QL object (ShopifyApp.ShopifyAnalytics).
Could you please add a note in the documentation on how the app can fetch analytics?
Thanks!
(EDIT: my original answer was a bit off the mark. I鈥檝e removed it to avoid confusion for future readers.)
Hi !
I'd love to do that but... what are the endpoints? The doc explicitly says that we need to use Embedded App SDK.
You鈥檙e right, there are no endpoints listed. I鈥檓 going to dig into this a bit more.
Any new information @bakura10 @ry5n? I was looking for the same
Nope, I'm still waiting for this one :(.
Sorry for the delay on this.
With the EmbeddedApp component, we expose some of the underlying EASDK functionality via React鈥檚 context as described here. The methods provided are showFlashNotice(), pushState(), redirect(), startLoading() and stopLoading().
It turns out the original EASDK offers an Analytics API. To make ShopifyQL queries, you鈥檇 use that API rather than making HTTP requests to endpoints.
It doesn鈥檛 look like an equivalent is current exposed by the EmbeddedApp component. I still need to confirm that. I鈥檒l also let you know if there鈥檚 a workaround and what plans exist to make it available in Polaris.
I will share news as soon as I got some piece of working code....thanks @ry5n !
I can confirm that currently using the React components there isn鈥檛 a direct way to access the regular EASDK (and make ShopifyQL calls) from the embedded React components. I鈥檝e logged this internally and we鈥檙e working on addressing these limitations.
Unfortunately we haven鈥檛 been able to put this at the top of our priority list, but we treat all feature requests as part of our backlog.
I鈥檒l close this issue for now, but we encourage everyone who wants this feature to add a 馃憤 to the original issue report. We鈥檒l take your collective interest into account when we look at what to work on next.
馃挏
Most helpful comment
Sorry for the delay on this.
With the EmbeddedApp component, we expose some of the underlying EASDK functionality via React鈥檚 context as described here. The methods provided are
showFlashNotice(),pushState(),redirect(),startLoading()andstopLoading().It turns out the original EASDK offers an Analytics API. To make ShopifyQL queries, you鈥檇 use that API rather than making HTTP requests to endpoints.
It doesn鈥檛 look like an equivalent is current exposed by the EmbeddedApp component. I still need to confirm that. I鈥檒l also let you know if there鈥檚 a workaround and what plans exist to make it available in Polaris.