Created
January 10, 2021 14:59
-
-
Save maximivanov/3f61626307f2f8cf5a9327e81c7d436b to your computer and use it in GitHub Desktop.
Make graphql requests with curl
This file contains 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
# 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