graphql-python/gql supports AWS AppSync since version 3.0.0rc0.
It supports queries, mutation and even subscriptions on the realtime endpoint.
It supports IAM, api key and JWT authentication methods.
And it has a gql-cli script which allows you to execute queries, mutations and subscriptions from the command line.
The documentation is available here
For queries and mutations, use the --transport appsync_http
argument:
# Put the request in a file
$ echo 'mutation createMessage($message: String!) {
createMessage(input: {message: $message}) {
id
message
createdAt
}
}' > mutation.graphql
# Execute the request using gql-cli with --transport appsync_http
$ cat mutation.graphql | gql-cli $AWS_GRAPHQL_API_ENDPOINT --transport appsync_http -V message:"Hello world!"
For subscriptions, use the --transport appsync_websockets
argument:
echo "subscription{onCreateMessage{message}}" | gql-cli $AWS_GRAPHQL_API_ENDPOINT --transport appsync_websockets