How to Insomnia for GraphQL requests
Complete video tutorial is online! Please check the playlist here. Total time would be in 8 minutes.
- Explore Github GraphQL API: https://youtu.be/fX7mxRCDgJI
- Download Insomnia client: https://youtu.be/Y2a68Zacv84
- Authenticate request: https://www.youtube.com/watch?v=QZCw5dcu5Yg
- Useful features for editing: https://www.youtube.com/watch?v=FkbTV_Q1a9Q
- How to share my workspace?: https://www.youtube.com/watch?v=86KkpFAYOkA
Use cases when we work with a GraphQL endpoint
- Send my first request to a new GraphQL endpoint
- Introspection query to fetch the schema
- Manage environment-related variables like the authentication token
- Manage a bunch of queries
- Save/Share requests with others
How to use Insomnia to manage my requests?
Please check the complete youtube videos for a demo!
Here we’re going to communicate with Github’s public GraphQL API. Basic steps would be:
- Automatic fetch GraphQL Schema from the endpoint.
- Authenticating the requests through a personal access token, set the token as an environment variable.
- Construct your query with the auto-complete feature enabled. Use variables when needed.
- Send and check your response, work on fixing errors.
- Export your current workspace and send it to your teammates. (Or use ‘Share’ feature which requires a Insomnia Plus subscription. 💰)
References
Originally published at https://www.usegitflow.com.