QueryGQL

Query a remote GraphQL endpoint and retrieve the data.

Added in version 1.0.0.

  • Friendly name: Deprecated: Query GraphQL

  • Step class: base_steps_syncpack.steps.QueryGQL.QueryGQL

  • Step version: 1.4.4

  • Required parameters: query_url

Parameters

Name

Type

Required

Default

Description

query

string (long)

no

–

The Graphql request to make against the remote endpoint Example: {devices{edges {node {id namedetail {statesnmpData {sysdescrsysuptimelastPolllocale}}}}}}

query_from_input

boolean

no

False

Whether or not to read the request from the input of a previous step. Overrides query if set

query_url

string

yes

–

THe URL that will be queried using the GQL call Example: http://host.example.com/gql

variables

json

no

{}

gql variables to include with query Example: {'count': 10}

save_errors

boolean

no

False

If there are errors found from the GQL response, save them along with the rest of the payload

follow_cursor

boolean

no

False

Whether or not to continually make calls following the last cursor. If this is enabled, their MUST be an after:”” present in your query. The gql query must also be sure to request the cursor property be present in the response, as well requesting pageInfo with hasNextPage in the response

edges_only

boolean

no

False

Whether or not to only include edges when parsing through response and saving data. If true, the return result will be a list of all edges foundwhen following cursor (if enabled). If false, the result will be the ‘data’ value of the response

mutation

boolean

no

False

Set to True for Mutation calls.

sub_key

string

no

–

Sub Key of the GQL Response to Page over. Example: constituents

Other inherited parameters

This step also accepts 6 optional parameter(s) inherited from QueryREST.

Every step also accepts the platform parameters common to all steps – see Platform parameters.

Dependencies

  • Inherits from: QueryGQL -> QueryREST -> BaseStep -> Serializable

  • SyncPack modules: base_steps_syncpack.steps.QueryREST

  • External packages: future, ipaascommon, ipaascore, requests

Warning

Deprecated. execute() logs a warning to refactor to GQLRequest. See Deprecated steps.

Behaviour

Nominally extends QueryREST, but it does not call super().__init__(). It therefore declares its own complete parameter set and reuses only QueryREST.make_rest_call. Treat it as an independent step that happens to share a base class in name only.

Because of that, it has none of the Shared parameters: HTTPBaseStep machinery: no OAuth, no bearer token, no mTLS, no token caching. Authentication is Basic (username / password) or nothing.

Outputs

save_data_for_next_step(save_data):

  • without follow_cursor, or for a mutation — the response_data dict, or the edges list when edges_only is set;

  • with follow_cursor — a list accumulated across pages.

save_errors wraps the result as {"data_out": ..., "errors": ...}.

Notes

Warning

Cursor following here works by regex-replacing after:"" in the query text with the last cursor. Your query must literally contain after:"" or paging silently does nothing and you get one page. GQLRequest replaced this with proper GraphQL variables (gql_offset_name), which is one of the main reasons to migrate.

  • The endpoint parameter is query_url, not the prefix_url / relative_url pair used everywhere else.

  • GQLResponse is defined locally in this module rather than imported from util.gql_utils, so its behaviour can differ subtly from GQLRequest.