Documentation

GraphQL
in package

Table of Contents

$client  : Client|null
$jwtToken  : string|null
$userName  : string|null
__construct()  : mixed
GraphQL constructor takes an optional script id.
MakeRequest()  : array<string|int, mixed>|bool|float|int|mixed|stdClass|string|void|null
askForJwtToken()  : mixed

Properties

$client

protected Client|null $client = null

$jwtToken

protected string|null $jwtToken = null

$userName

protected string|null $userName = null

Methods

__construct()

GraphQL constructor takes an optional script id.

public __construct([null $scriptId = null ]) : mixed

There are three use cases:

  1. we are calling this class from headless script, we set the username to the script name e.g. "script_test"
  2. we are calling this class from browser script, we set the username to the logged-in username and script name e.g. "jdoe.script_test"
  3. we are calling this class without a script, we set the username to just the logged-in username
Parameters
$scriptId : null = null
Tags
throws
Exception
Return values
mixed

MakeRequest()

public MakeRequest( $query) : array<string|int, mixed>|bool|float|int|mixed|stdClass|string|void|null
Parameters
$query :
Tags
throws
GuzzleException
Return values
array<string|int, mixed>|bool|float|int|mixed|stdClass|string|void|null

askForJwtToken()

private askForJwtToken( $table) : mixed
Parameters
$table :
Tags
throws
GuzzleException
Return values
mixed

Search results