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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<?php
namespace WPGraphQL;
use GraphQL\Error\UserError;
use GraphQL\Executor\Executor;
use GraphQL\Schema;
use GraphQL\Type\Definition\FieldDefinition;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\ResolveInfo;
use WPGraphQL\Type\WPObjectType;
/**
* Class WPSchema
*
* Extends the Schema to make some properties accessible via hooks/filters
*
* @package WPGraphQL
*/
class WPSchema extends Schema {
/**
* Holds the $filterable_config which allows WordPress access to modifying the
* $config that gets passed down to the Executable Schema
*
* @var array|null
* @since 0.0.9
*/
public $filterable_config;
/**
* WPSchema constructor.
*
* @param array|null $config
*
* @since 0.0.9
*/
public function __construct( $config ) {
/**
* Set the $filterable_config as the $config that was passed to the WPSchema when instantiated
*
* @since 0.0.9
*/
$this->filterable_config = apply_filters( 'graphql_schema_config', $config );
parent::__construct( $this->filterable_config );
}
}