Skip to content

Instantly share code, notes, and snippets.

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']);