protected function registerMetaFields()
    {
        $this->container
            ->share(GraphQL::SCHEMA_META_FIELD_DEFINITION, function ($__Schema) {
                return newField([
                    'name'        => '__schema',
                    'description' => 'Access the current type schema of this server.',
                    'type'        => newNonNull($__Schema),
                    'resolve'     => function ($source, $args, $context, ResolveInfo $info): Schema {
                        return $info->getSchema();
                    },
                ]);
            })
            ->addArgument(GraphQL::SCHEMA_INTROSPECTION);

        $this->container
            ->share(GraphQL::TYPE_META_FIELD_DEFINITION, function ($__Type) {
                return newField([
                    'name'        => '__type',
                    'description' => 'Request the type information of a single type.',
                    'type'        => $__Type,
                    'args'        => ['name' => ['type' => newNonNull(stringType())]],
                    'resolve'     => function ($source, $args, $context, ResolveInfo $info): ?TypeInterface {
                        ['name' => $name] = $args;
                        return $info->getSchema()->getType($name);
                    },
                ]);
            })
            ->addArgument(GraphQL::TYPE_INTROSPECTION);

        $this->container
            ->share(GraphQL::TYPE_NAME_META_FIELD_DEFINITION, function () {
                return newField([
                    'name'        => '__typename',
                    'description' => 'The name of the current Object type at runtime.',
                    'type'        => newNonNull(stringType()),
                    'resolve'     => function ($source, $args, $context, ResolveInfo $info): string {
                        return $info->getParentType()->getName();
                    },
                ]);
            });
    }
protected function registerMetaFields()
    {
        $this->container
            ->share(GraphQL::SCHEMA_META_FIELD_DEFINITION, function ($__Schema) {
                return newField([
                    'name'        => '__schema',
                    'description' => 'Access the current type schema of this server.',
                    'type'        => newNonNull($__Schema),
                    'resolve'     => function ($source, $args, $context, ResolveInfo $info): Schema {
                        return $info->getSchema();
                    },
                ]);
            })
            ->addArgument(GraphQL::SCHEMA_INTROSPECTION);

        $this->container
            ->share(GraphQL::TYPE_META_FIELD_DEFINITION, function ($__Type) {
                return newField([
                    'name'        => '__type',
                    'description' => 'Request the type information of a single type.',
                    'type'        => $__Type,
                    'args'        => ['name' => ['type' => newNonNull(stringType())]],
                    'resolve'     => function ($source, $args, $context, ResolveInfo $info): ?TypeInterface {
                        ['name' => $name] = $args;
                        return $info->getSchema()->getType($name);
                    },
                ]);
            })
            ->addArgument(GraphQL::TYPE_INTROSPECTION);

        $this->container
            ->share(GraphQL::TYPE_NAME_META_FIELD_DEFINITION, function () {
                return newField([
                    'name'        => '__typename',
                    'description' => 'The name of the current Object type at runtime.',
                    'type'        => newNonNull(stringType()),
                    'resolve'     => function ($source, $args, $context, ResolveInfo $info): string {
                        return $info->getParentType()->getName();
                    },
                ]);
            });
    }
protected function registerMetaFields ( ) { $ this -> container -> share ( GraphQL :: SCHEMA_META_FIELD_DEFINITION , function ( $ __Schema ) { return newField ( [ 'name' => '__schema' , 'description' => 'Access the current type schema of this server.' , 'type' => newNonNull ( $ __Schema ) , 'resolve' => function ( $ source , $ args , $ context , ResolveInfo $ info ) : Schema { return $ info -> getSchema ( ) ; } , ] ) ; } ) -> addArgument ( GraphQL :: SCHEMA_INTROSPECTION ) ; $ this -> container -> share ( GraphQL :: TYPE_META_FIELD_DEFINITION , function ( $ __Type ) { return newField ( [ 'name' => '__type' , 'description' => 'Request the type information of a single type.' , 'type' => $ __Type , 'args' => [ 'name' => [ 'type' => newNonNull ( stringType ( ) ) ] ] , 'resolve' => function ( $ source , $ args , $ context , ResolveInfo $ info ) : ? TypeInterface { [ 'name' => $ name ] = $ args ; return $ info -> getSchema ( ) -> getType ( $ name ) ; } , ] ) ; } ) -> addArgument ( GraphQL :: TYPE_INTROSPECTION ) ; $ this -> container -> share ( GraphQL :: TYPE_NAME_META_FIELD_DEFINITION , function ( ) { return newField ( [ 'name' => '__typename' , 'description' => 'The name of the current Object type at runtime.' , 'type' => newNonNull ( stringType ( ) ) , 'resolve' => function ( $ source , $ args , $ context , ResolveInfo $ info ) : string { return $ info -> getParentType ( ) -> getName ( ) ; } , ] ) ; } ) ; }
Registers the introspection meta fields with the container.
Registers the introspection meta fields with the container .