GraphQL\Type\Introspection::_schema PHP Method

_schema() public static method

public static _schema ( )
    public static function _schema()
    {
        if (!isset(self::$map['__Schema'])) {
            self::$map['__Schema'] = new ObjectType(['name' => '__Schema', 'description' => 'A GraphQL Schema defines the capabilities of a GraphQL ' . 'server. It exposes all available types and directives on ' . 'the server, as well as the entry points for query and ' . 'mutation operations.', 'fields' => ['types' => ['description' => 'A list of all types supported by this server.', 'type' => new NonNull(new ListOfType(new NonNull(self::_type()))), 'resolve' => function (Schema $schema) {
                return array_values($schema->getTypeMap());
            }], 'queryType' => ['description' => 'The type that query operations will be rooted at.', 'type' => new NonNull(self::_type()), 'resolve' => function (Schema $schema) {
                return $schema->getQueryType();
            }], 'mutationType' => ['description' => 'If this server supports mutation, the type that ' . 'mutation operations will be rooted at.', 'type' => self::_type(), 'resolve' => function (Schema $schema) {
                return $schema->getMutationType();
            }], 'subscriptionType' => ['description' => 'If this server support subscription, the type that subscription operations will be rooted at.', 'type' => self::_type(), 'resolve' => function (Schema $schema) {
                return $schema->getSubscriptionType();
            }], 'directives' => ['description' => 'A list of all directives supported by this server.', 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_directive()))), 'resolve' => function (Schema $schema) {
                return $schema->getDirectives();
            }]]]);
        }
        return self::$map['__Schema'];
    }

Usage Example

 public function testPassesOnTheIntrospectionSchema()
 {
     $schema = new Schema(Introspection::_schema());
     $validationResult = SchemaValidator::validate($schema);
     $this->assertSame(true, $validationResult->isValid);
     $this->assertSame(null, $validationResult->errors);
 }
All Usage Examples Of GraphQL\Type\Introspection::_schema