Skip to main content

GraphQL Playground

  1. On the Hypi platform, you can execute various GraphQL methods with GraphQL playground. Click on API Instances. Select the instance from the list of instances. Select Playground tab.

GQLPlay

  1. A sample FindAccount query is always present in the starting tab. Click on the + button to add a new tab to execute a method.

GQLPlay

  1. Note that HTTP request headers get automatically added. The same request headers are present in the API configurations of the instance.

GQLPlay

  1. Write the method. Enter input data under the QUERY VARIABLES tab. Hit the blue play button to execute the method. You will get the response on the right-hand side box.

GQLPlay

  1. You can check the history of executed methods (APIs) by clicking the History button.

GQLPlay

  1. Select the method and click the Use button to again insert the method in a tab on GraphQL Playground.

GQLPlay

  1. You may correct the improperly formatted code with Prettify button

GQLPlay

  1. The brackets get aligned properly with Prettify.

GQLPlay

  1. You may see the endpoint in a box to make an HTTP request. You may refresh the instance by clicking refresh symbol in front of it. Click Copy CURL to copy the HTTP request.

GQLPlay

Paste the copied CURL to verify the request.

curl 'https://api.alpha.hypi.dev/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://alpha.hypi.dev' -H 'Authorization: <Auth Key>' -H 'hypi-domain: ignorant.apps.hypi.app' --data-binary '{"query":"mutation Upsert($values: HypiUpsertInputUnion!) {\n  upsert(values: $values) {\n    id\n  }\n}\n","variables":{"values":{"Author":[{"name":"Dan Brown","age":56,"booklist":[{"title":"Da Vinci Code","publication":"abc","available":true}]}]}}}' --compressed