Created
November 28, 2022 14:29
-
-
Save lcswillems/c8f6724f64bbc21b2cd9104dd64c8370 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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