-
Notifications
You must be signed in to change notification settings - Fork 611
/
RegisterGqlEagerLoadableFields.php
35 lines (32 loc) · 1.51 KB
/
RegisterGqlEagerLoadableFields.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\events;
use yii\base\Event;
/**
* RegisterGqlEagerLoadableFields class.
*
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 3.5.0
*/
class RegisterGqlEagerLoadableFields extends Event
{
/**
* @var array List of additional eager-loadable fields to be used as reference, when parsing the GraphQL query and building the eager-load condition array.
*
* The field list is an array, where the key is the field name to be allowed. The value is a list of allowed occurrences for the node in the form of an array.
* Occurrence is a class name of a relational field that the containing field must be an instance of. For example, the "uploader" field can be eager-loaded only
* for Asset fields, so the occurrence will be `craft\fields\Assets`.
*
* If a field is encountered in a GraphQL query outside of a relational field scope, it is always allowed.
*
* There are two special values you can use:
* - '*' can be used both as a key or value and is used to configure the field to be allowed anywhere.
* - 'canBeAliased' is used to configure whether the GraphQL field alias (if any) can be used when constructing the eager-loading parameters. Defaults to `true`.
* To invert the behavior, use `canBeAliased` as a key and set the value to the required boolean value.
*/
public array $fieldList = [];
}