Skip to content

Instantly share code, notes, and snippets.

@jahilldev
Created September 5, 2024 15:50
Show Gist options
  • Save jahilldev/1fc82dc01b711655b3702b8b7ec7904b to your computer and use it in GitHub Desktop.
Save jahilldev/1fc82dc01b711655b3702b8b7ec7904b to your computer and use it in GitHub Desktop.
Example Skio API Request (Hangs, Timeout)
const query = `#graphql
query getSubscriptions($email: String!) {
Subscriptions(
where: {
StorefrontUser: { email: { _eq: $email } }
},
order_by: { createdAt: desc }
) {
id
platformId
createdAt
}
SubscriptionLines(where: { removedAt: { _is_null: true } }) {
priceWithoutDiscount
ProductVariant {
title
Product {
id
title
}
}
}
}
`;
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/graphql',
authorization: `API ${API_KEY}`,
},
body: JSON.stringify({ query, variables: { email } }),
signal: AbortSignal.timeout(5000),
});
const data = await response.json();
console.log('response', { data });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment