Page tree
Skip to end of metadata
Go to start of metadata

GraphQL is still just a REST call, so it has a Request property passed into the getRequest() method. The response is accessible as a string via the getResultContent() method. It is passed to the ResultContainer property which is accessible via the getResultContainer() method and auto-parsed via the parseResultContainer() method.

The ResultContainer will contain:

  • a DataContainer property with the data response, accessed via getData() method. That will contain methods to retrieve the relevant content you need.
  • potentially a List of ErrorContainer objects for any errors returned, accessed via getErrors() method.

Your code should check for errors and handle accordingly. However, if the DataContainer is null, an exception will be raised to advise that you check for errors. getResultContent() is useful then to check the string data returned from the request.

Note: a small number of GraphQL requests cannot be run from an application - "me" and "people(name)" - which run based on your organisation. These currently return an HTTP 500 error.