Created
March 29, 2022 23:29
-
-
Save sjwaight/ec28fc08da1f7d2ff3a4abdbfdeab5e0 to your computer and use it in GitHub Desktop.
Bash script showing how to invoke a GraphQL API using 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
# 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