Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Python AWS AppSync Client?

I am currently looking for a python lib that could allow me to use my AWS AppSync API from my backend.

I looked at Graphene, but I didn't see support for AWS auth.

I also look at appsync-client, but the documentation is non-existent and the maintenance of the project seems to me absent.

If you have experience or the same concerns, your comments are welcome in order to find a solution together :)

like image 541
revers Avatar asked Jul 24 '26 20:07

revers


1 Answers

AppSync API has two endpoints.

HTTPS endpoint such as <id>.appsync-api.<region>.amazonaws.com : For Query and Mutation, you can use a generic HTTP client to do POST with the GraphQL query as the body. If it's AWS IAM auth, you can refer to this guide. If it's API key auth, you need to add x-api-key: <key> to the headers. If it's Cognito auth, you need to add Authorization: <jwt> to the headers.

WSS endpoint such as <id>.appsync-realtime-api.<region>.amazonaws.com : For subscription, you can refer to this tutorial for python client implementation.

Please let me know if you have any question.

like image 131
jzthinkgeek Avatar answered Jul 27 '26 09:07

jzthinkgeek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!