Created
October 29, 2023 12:50
-
-
Save ChrisHPZ/386e51f4bd1d0d4eac0be7da8a031f58 to your computer and use it in GitHub Desktop.
GraphQL Request
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 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