curlやHTTPieでGraphQLを送る
curlでも使える
code:bash
curl 'http://snowtooth.herokuapp.com/' \
-H 'Content-Type: application/json' \
--data '{"query":"{ allLifts { name }}"}'
見て分かる通り、こんなqueryをおくってる
code:graphql
{
allLifts {
name
}
}
mutation
code:bash
curl 'http://snowtooth.herokuapp.com/' \
-H 'Content-Type: application/json' \
--data '{"query":"mutation {setLiftStatus(id: \"panorama\" status: OPEN) {name status}}"}'
HTTPieなら
code:bash
λ http POST http://snowtooth.herokuapp.com query='{"query":"{ allLifts { name }}"}'