How to Send GraphQL Queries Using SOAtest
It is possible to use the REST and Messaging Clients in SOAtest to send GraphQL queries. You just need to configure the payload correctly.
GraphQL queries resemble JSON a little bit, but they are not in JSON format (meaning you can't build or parse them as JSON).
So what you'll want to do is encode the GraphQL query as a JSON string and then POST it in a simple JSON object containing a string property called "query."
You'll want your Form JSON view to look something like this:
If you've configured the payload correctly, you should be able to get a successful response.
Note: GraphQL response payloads are returned in JSON format, so you'll be able to use any of the JSON tools in SOAtest to consume the response (e.g. extractions and validations).
Comments
-
SOAtest now has a GraphQL client that simplifies the construction and messaging of GraphQL queries. There is an editor for configuring the query and controls to specify how to encode the query in the HTTP request (one of five different ways).
See the release notes for SOAtest 2022.1.
0 -
The SOAtest GraphQL Client can now consume a GraphQL Schema Definition Language (SDL) document. This simplifies building queries, where the Form GraphQL view is populated with controls to select and configure the available fields, arguments, etc.
See the release notes for SOAtest 2022.2.
0