Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to Send GraphQL Queries Using SOAtest

Options
lribaya
lribaya Posts: 2

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).

Tagged:

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,232 ✭✭✭
    Options

    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.

  • benken_parasoft
    benken_parasoft Posts: 1,232 ✭✭✭
    Options

    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.

Tagged