Discover our knowledge. Read our blogs!

Learn more

We build all our solutions with WSO2 and we are proud that we are Platinum Value-Added Reseller of WSO.

Learn more

GraphQL in WSO2 API Manager Developer Portal Console

4 min read

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.

 

Contact us

 

Care to share?
   
Picture of Kashmira Ray
Published July 23, 2020

Kashmira Ray

Kashmira has more than 4 years of experience working in Java/.Net development with expert knowledge of relational databases, and product development. It is her passion to develop state of the art ‘products’ using java/.Net and web services.

Responses

Stay up to date with the latest articles