Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash script showing how to invoke a GraphQL API using curl.
# Originally from: https://www.meetup.com/api/guide/#p02-querying-section
query='query($eventId: ID) {
event(id: $eventId) {
title
description
dateTime
}
}
'
variables='{
"eventId": "276754274"
}'
query="$(echo $query)"
curl -X POST https://api.meetup.com/gql \
-H 'Authorization: Bearer {YOUR_TOKEN}' \
-H 'Content-Type: application/json' \
-d @- <<EOF
{"query": "$query", "variables": "$variables"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment