export default function gqlApi(query: string, variables: object = {}): Promise { return fetch(window.env.GRAPHQL_URL, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ query, variables }), }) .then(res => res.json()) .then(({ data }) => data); }