Skip to content

Instantly share code, notes, and snippets.

@maximivanov
Created January 10, 2021 14:59
Show Gist options
  • Save maximivanov/3f61626307f2f8cf5a9327e81c7d436b to your computer and use it in GitHub Desktop.
Save maximivanov/3f61626307f2f8cf5a9327e81c7d436b to your computer and use it in GitHub Desktop.
Make graphql requests with curl
# GraphQL query
curl 'http://localhost:7071/graphql' \
-X POST \
-H 'content-type: application/json' \
--data '{
"query":"{ posts { id } }"
}'
# GraphQL mutation
curl 'http://localhost:7071/graphql' \
-X POST \
-H 'content-type: application/json' \
--data '{
"query":"mutation { createUser(email: \"user@host\") }"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment