I’m trying to use the Shopify Resource Fetching https://shopify.dev/docs/api/app-bridge-library/apis/resource-fetching#example-fetch-directly-from-the-admin-api with the AbortController, but it doesn’t work. I pass the signal to the fetch and abort the signal, but nothing. Could you take a look at it?
const SHOPIFY_ADMIN_GRAPHQL_API = "shopify:admin/api/graphql.json";
export default async ({ query, signal = null /*, variables = {}*/ }) => {
try {
const response = await fetch(SHOPIFY_ADMIN_GRAPHQL_API, {
method: "POST",
signal,
body: JSON.stringify({
query,
}),
});
if (!response.ok) throw new Error(response.statusText);
return await response.json();
} catch (error) {
throw new Error(error);
}