class Controller extends Controller implements Flushable

Top level controller for handling graphql requests.

Constants

CACHE_FILENAME

Config options

cors array Cors default config
cache_types_in_filesystem bool If true, store the fragment JSON in a flat file in assets/
cache_on_flush bool Toggles caching types to the file system on flush This is set to false in test state see DisableTypeCacheState

Methods

__construct(Manager $manager = null)

No description

HTTPResponse
index(HTTPRequest $request)

Handles requests to the index action (e.g. /graphql)

getManager(HTTPRequest $request = null)

No description

$this
setManager(Manager $manager)

No description

$this
setAssetHandler(GeneratedAssetHandler $handler)

No description

GeneratedAssetHandler
getAssetHandler()

No description

getAuthHandler()

Get an instance of the authorization Handler to manage any authentication requirements

string
getToken()

No description

HTTPResponse
addCorsHeaders(HTTPRequest $request, HTTPResponse $response)

Process the CORS config options and add the appropriate headers to the response.

writeSchemaToFilesystem()

Introspect the schema and persist it to the filesystem

removeSchemaFromFilesystem()

No description

writeTypes(string $content)

No description

processTypeCaching()

Write the types json to a flat file, if silverstripe/assets is available

static 
flush()

No description

Details

at line 77
__construct(Manager $manager = null)

Parameters

Manager $manager

at line 97
HTTPResponse index(HTTPRequest $request)

Handles requests to the index action (e.g. /graphql)

Parameters

HTTPRequest $request

Return Value

HTTPResponse

at line 140
Manager getManager(HTTPRequest $request = null)

Parameters

HTTPRequest $request

Return Value

Manager

at line 163
$this setManager(Manager $manager)

Parameters

Manager $manager

Return Value

$this

at line 174
$this setAssetHandler(GeneratedAssetHandler $handler)

Parameters

GeneratedAssetHandler $handler

Return Value

$this

at line 184
GeneratedAssetHandler getAssetHandler()

Return Value

GeneratedAssetHandler

at line 194
Handler getAuthHandler()

Get an instance of the authorization Handler to manage any authentication requirements

Return Value

Handler

at line 202
string getToken()

Return Value

string

at line 214
HTTPResponse addCorsHeaders(HTTPRequest $request, HTTPResponse $response)

Process the CORS config options and add the appropriate headers to the response.

Parameters

HTTPRequest $request
HTTPResponse $response

Return Value

HTTPResponse

at line 415
writeSchemaToFilesystem()

Introspect the schema and persist it to the filesystem

Exceptions

Exception

at line 430
removeSchemaFromFilesystem()

at line 442
writeTypes(string $content)

Parameters

string $content

at line 453
processTypeCaching()

Write the types json to a flat file, if silverstripe/assets is available

at line 462
static flush()