Back to Blog
Postman graphql example7/7/2023 ![]() ![]() In the next blog, we show how you can perform those admin operations on your Slash GraphQL backend using Postman collections. By using collections andĮnvironment variables you can automate the recording and passing of the access token. These operations require you to log inĪs an administrator, record the access token returned from login, and pass that access token back ![]() Operations like backup, restore and setting access control. You canĪlso dynamically update these environment variables based on the response of a request.Īs an example, you administer your Dgraph instance using GraphQL, and thus use GraphQL to perform You can have different environments for your development, staging and production clusters. Way for the team to try out requests without “having to worry about the syntax”.Ĭollections along with environment variables make it easy to develop, test and monitor your API.įor example, the URL for your requests can be dynamically filled in from an environment variable and This collection can then be shared with your team which provides a convenient and easy With Postman, you can create a collection that is a way of grouping your Type Task Įven though GraphQL APIs are self-documenting, having examples of common patterns of using theĪPI can be very useful. Ĭhoose the Body type as raw as shown in the image below. So for the local instance, the URL will be: and for the remote one. We’ll use the example of building a GraphQL API for a TODO app for this blog post.Īs an initial step, we’ll post the following GraphQL schema for our application to both our local and remote endpoints. With Dgraph you can turn a GraphQL schema into a running GraphQL API ![]() To see these features, we’ll use the Dgraph server that should be already running from Step 1 above. Some other features like GraphQL variables, Postman environment variables, query auto-completion. Now that we have had a look at how GraphQL queries work in Postman, we’ll also take a look at Benefits of using Postman with GraphQL queries In the next part, we’ll see how can we post a new schema to our cluster and execute some queries and mutations based on that. But since both the local and remote APIs don’t yet have a schema to serve, you would get a null schema back. That’s it! Now you can hit the Send button and get the GraphQL schema that is being served by yourĭgraph cluster.
0 Comments
Read More
Leave a Reply. |