Create GraphQL APIs

  1. Save and download the sample StarWarsAPI.graphql file. This is the GraphQL SDL of the API that we will be using.
  2. Login to the Publisher Console API Publisher of the WSO2 API Manager.
  3. Under the GraphQL option, use Import GraphQL SDL option.
  4. Provide the GraphQL definition of the API that was downloaded in step 1 and click Next.
  5. Provide the following information.
Field Sample value
Name StarWarsAPI
Context /starwars
Version 1.0.0
Endpoint http://graphql-faker-service:9002/graphql
  1. Select the APK Gateway and click Create.
  2. Navigate to the Deploy section and click Deployments.
  3. Click Deploy New Revision.
  4. Optionally, provide a description for the revision.
  5. Select the APK Gateways in which you want to deploy the API and click Deploy.
  6. Navigate to Life Cycle tab. Then click Publish to publish the API.
  7. To verify the API deployment in the APK Gateway, execute the following command. You will see the status of the deployed apis as follows once completed.
kubectl get apis -n <namespace>