class GraphQLSchema in GraphQL 8.3
Annotation for GraphQL schema plugins.
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\graphql\Annotation\GraphQLSchema
Expanded class hierarchy of GraphQLSchema
1 string reference to 'GraphQLSchema'
2 classes are annotated with GraphQLSchema
- DefaultSchema in modules/
graphql_core/ src/ Plugin/ GraphQL/ Schemas/ DefaultSchema.php - Default generated schema.
- TestSchema in tests/
modules/ graphql_test/ src/ Plugin/ GraphQL/ Schemas/ TestSchema.php - Default generated schema.
File
- src/
Annotation/ GraphQLSchema.php, line 12
Namespace
Drupal\graphql\AnnotationView source
class GraphQLSchema extends Plugin {
/**
* The schema name.
*
* @var string
*/
public $name;
/**
* The schema path.
*
* @var string
*/
public $path;
/**
* Weight for precedence calculations.
*
* If multiple components with the same name are available, the highest
* weight wins.
*
* @var int
*/
public $weight = 0;
/**
* GraphQLSchema constructor.
*
* @param mixed $values
* The plugin annotation values.
*
* @throws \Doctrine\Common\Annotations\AnnotationException
* In case of missing required values.
*/
public function __construct($values) {
if (!array_key_exists('id', $values) || !$values['id']) {
throw new AnnotationException('GraphQL schema is missing an "id" property.');
}
if (!array_key_exists('path', $values) || !$values['path']) {
throw new AnnotationException('GraphQL schema is missing an "path" property.');
}
parent::__construct($values);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GraphQLSchema:: |
public | property | The schema name. | |
GraphQLSchema:: |
public | property | The schema path. | |
GraphQLSchema:: |
public | property | Weight for precedence calculations. | |
GraphQLSchema:: |
public | function |
GraphQLSchema constructor. Overrides Plugin:: |
|
Plugin:: |
protected | property | The plugin definition read from the class annotation. | 1 |
Plugin:: |
public | function |
Gets the value of an annotation. Overrides AnnotationInterface:: |
5 |
Plugin:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
protected | function | Parses an annotation into its definition. | |
Plugin:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |