Skip to content

Instantly share code, notes, and snippets.

@ChrisHPZ
Created October 29, 2023 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisHPZ/386e51f4bd1d0d4eac0be7da8a031f58 to your computer and use it in GitHub Desktop.
Save ChrisHPZ/386e51f4bd1d0d4eac0be7da8a031f58 to your computer and use it in GitHub Desktop.
GraphQL Request
export async function graphqlRequest(query) {
const url = "removed-for-security";
const headers = { 'Content-Type' : 'application/json' };
const res = await fetch(url, {
headers,
method: 'POST',
body: JSON.stringify(query)
});
const resJson = await res.json();
return resJson;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment