In this section:
You can specify how you want to enter messages from the Input Mode menu in message tools and responders like Request, Response, and Payload. The Form GraphQL input mode provides a tree view of the GraphQL message so that you can construct and review GraphQL messages in a graphical interface. This mode is a GraphQL-focused version of the Form Input mode.
You can constrain your GraphQL message to a schema definition by linking it to an SDL. To build a GraphQL message constrained to an SDL:
If the SDL is updated, return to this screen and click Refresh SDL to update the constraints for the GraphQL message.
When constrained to an SDL, you will be limited in what elements you can use when building out your tree according to the schema. How you add them depends on their type:
Select the top-level node ( {}
) and click Insert for either the Query, Mutation, or Subscription table.
Fields can be added to operations, fragments, or other fields, as specified by the SDL. To include a field:
Arguments can be added to fields or directives. Required arguments, as specified by the SDL, are automatically included. Optional arguments are not automatically included. To include an optional argument:
Arguments can be converted into variables. To do so, right-click the desired argument node and choose Switch to Variable Reference.
Directives can be added to operations, fragments, fields, or variables, as specified by the SDL. To include a directive:
Variables can be added to operations. To add a variable:
To remove a field, argument, or directive, select its parent node and uncheck it. To remove a variable, select it in the Variables table and click Delete.
You can build an unconstrained GraphQL message manually or, if you have a GraphQL message available, use it to build your Form GraphQL. To do so, paste your GraphQL message into the Literal view, then switch to Form GraphQL view. The Form GraphQL view will automatically be populated with the provided values and show a graphical representation of the message.
You can add new GraphQL operations from the form view. Select the top-level node ( {}
) and click Insert for either the Query, Mutation, or Subscription table.
Whether you pasted a GraphQL message into the Literal view and converted it to Form GraphQL view or added an operation manually, you can add and remove fields, arguments, directives, and variables from the form view as well.
Fields can be added to operations or other fields. To add a field:
Arguments can be added to fields or directives. To add an argument to a field:
To add an argument to a directive:
Directives can be added to operations, fields, or variables. To add a directive:
Variables can be added to operations. To add a variable:
To remove a field, argument, or directive, right-click the node and choose Delete. To remove a variable, select it in the Variables table and click Delete.
You can specify values using the fixed, parameterized, auto, and script options available across the various tree views.
Note that Form Input options which are applicable to GraphQL are available from this view (with relevant terminology changes, such as null vs nil). This includes populating the entire tree with values in a data source, generating a CSV data source template, replacing specific elements with data source values, and so on. For details, see Form Input.
Switching to the Literal view will apply the contents of Form GraphQL to the Literal view. Right-clicking GraphQL messages in the Literal view allows you to automatically "beautify" the GraphQL.