Skip to content

Instantly share code, notes, and snippets.

@lcswillems
Created November 28, 2022 14:29
Show Gist options
  • Save lcswillems/c8f6724f64bbc21b2cd9104dd64c8370 to your computer and use it in GitHub Desktop.
Save lcswillems/c8f6724f64bbc21b2cd9104dd64c8370 to your computer and use it in GitHub Desktop.
export const fetchGraphql = (url: string, query: string) => fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query })
}).then(res => res.json()).then(res => res['data']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment