protected function generateInputType(Manager $manager)
    {
        return new InputObjectType([
            'name' => $this->inputTypeName(),
            'fields' => function () use ($manager) {
                $fields = [
                    'ID' => [
                        'type' => Type::nonNull(Type::id()),
                    ],
                ];
                $instance = $this->getDataObjectInstance();

                // Setup default input args.. Placeholder!
                $schema = Injector::inst()->get(DataObjectSchema::class);
                $db = $schema->fieldSpecs($this->getDataObjectClass());

                unset($db['ID']);

                foreach ($db as $dbFieldName => $dbFieldType) {
                    /** @var DBField|TypeCreatorExtension $result */
                    $result = $instance->obj($dbFieldName);
                    // Skip complex fields, e.g. composite, as that would require scaffolding a new input type.
                    if (!$result->isInternalGraphQLType()) {
                        continue;
                    }
                    $arr = [
                        'type' => $result->getGraphQLType($manager),
                    ];
                    $fields[$dbFieldName] = $arr;
                }
                return $fields;
            }
        ]);
    }
protected function generateInputType(Manager $manager)
    {
        return new InputObjectType([
            'name' => $this->inputTypeName(),
            'fields' => function () use ($manager) {
                $fields = [
                    'ID' => [
                        'type' => Type::nonNull(Type::id()),
                    ],
                ];
                $instance = $this->getDataObjectInstance();

                // Setup default input args.. Placeholder!
                $schema = Injector::inst()->get(DataObjectSchema::class);
                $db = $schema->fieldSpecs($this->getDataObjectClass());

                unset($db['ID']);

                foreach ($db as $dbFieldName => $dbFieldType) {
                    /** @var DBField|TypeCreatorExtension $result */
                    $result = $instance->obj($dbFieldName);
                    // Skip complex fields, e.g. composite, as that would require scaffolding a new input type.
                    if (!$result->isInternalGraphQLType()) {
                        continue;
                    }
                    $arr = [
                        'type' => $result->getGraphQLType($manager),
                    ];
                    $fields[$dbFieldName] = $arr;
                }
                return $fields;
            }
        ]);
    }
protected function generateInputType ( Manager $ manager ) { return new InputObjectType ( [ 'name' => $ this -> inputTypeName ( ) , 'fields' => function ( ) use ( $ manager ) { $ fields = [ 'ID' => [ 'type' => Type :: nonNull ( Type :: id ( ) ) , ] , ] ; $ instance = $ this -> getDataObjectInstance ( ) ; // Setup default input args.. Placeholder! $ schema = Injector :: inst ( ) -> get ( DataObjectSchema :: class ) ; $ db = $ schema -> fieldSpecs ( $ this -> getDataObjectClass ( ) ) ; unset ( $ db [ 'ID' ] ) ; foreach ( $ db as $ dbFieldName => $ dbFieldType ) { /** @var DBField|TypeCreatorExtension $result */ $ result = $ instance -> obj ( $ dbFieldName ) ; // Skip complex fields, e.g. composite, as that would require scaffolding a new input type. if ( ! $ result -> isInternalGraphQLType ( ) ) { continue ; } $ arr = [ 'type' => $ result -> getGraphQLType ( $ manager ) , ] ; $ fields [ $ dbFieldName ] = $ arr ; } return $ fields ; } ] ) ; }
Based on the args provided, create an Input type to add to the Manager.
@param Manager $manager
@return InputObjectType
Based on the args provided create an Input type to add to the Manager .