fb
WSO2 Tutorial 1 min

GraphQL in WSO2 API Manager Developer Portal Console

kashmira ray
Kashmira Ray
Integration Consultant
Yenlo blog GraphQL in WSO2 API Manager Developer Portal Console
Scroll

Yenlo-blog-GraphQL-in-WSO2-API-Manager-Developer-Portal-ConsoleIn my previous blog I have described how to create a GraphQL API in WSO2 API Manager. In this blog, I will be testing the same API using the WSO2 API Manager developer portal. To test the GraphQL API published in the WSO2 API Manager devportal, we first need to subscribe to the API through an application. You can reach the WSO2 API Manager devportal at https://localhost:9443/devportal and login using your credentials. Click on the subscribe button available in the overview page of the API.

GraphQL in WSO2 API Manager Developer Portal Console-subscribe

It redirects to the subscription page where we need to create an application. I have created a sample application named SpaceX with unlimited throttling and access token type as JWT.

GraphQL in WSO2 API Manager Developer Portal Console-SpaceXAPI

Once the application is created, the application is automatically subscribed to the SpaceXAPI by clicking on the next button. Here we can also choose the grant type to be used for token generation.

GraphQL in WSO2 API Manager Developer Portal Console-SpaceXAPI-grant-type

As we have restricted one of the operations of SpaceXAPI to adminScope scope previously, we will use the same scope to generate access token.

GraphQL in WSO2 API Manager Developer Portal Console-access-token

Once the access token is generated, copy the token and click on test button to navigate to Try Out console.

GraphQL in WSO2 API Manager Developer Portal Console-try-out-console

Once it opens the Try Out console, paste the copied access token in access token field.

The query is defined in the schema definition of GraphQL. GraphQL gives us the flexibility to query only the necessary attributes instead of querying all the attributes defined in the query schema definition.  

To query the necessary data pass the payload inside query{}. By clicking on the execute button next to GraphQL, we get the json data.

GraphQL in WSO2 API Manager Developer Portal Console-json-data

So, in this blog you discovered how to test an API using the WSO2 API Manager developer portal. I hope this was useful. In case you have a question, or if you are in need of WSO2 Support, don’t hesitate to leave a comment below or contact us via our contact form.

Full API lifecycle Management Selection Guide

WHITEPAPER

smartmockups l0qqucke