protected function updateRelations(array $fields, $argument = false)
    {
        foreach ($fields as $key => $field){
            /** @var TypeAbstract $value */
            foreach ($field as $name => $value){
                if($name == 'type') {
                    if($value instanceof ListType) {
                        if($value->getItemType() instanceof TypeAbstract ) {
                            $fields[$key][$name] = new ListType($value->getItemType()->init($argument));
                        }
                    }

                    if($value instanceof TypeAbstract){
                        $fields[$key][$name] = $value->init($argument);
                    }
                }

            }
        }

        return $fields;
    }
protected function updateRelations(array $fields, $argument = false)
    {
        foreach ($fields as $key => $field){
            /** @var TypeAbstract $value */
            foreach ($field as $name => $value){
                if($name == 'type') {
                    if($value instanceof ListType) {
                        if($value->getItemType() instanceof TypeAbstract ) {
                            $fields[$key][$name] = new ListType($value->getItemType()->init($argument));
                        }
                    }

                    if($value instanceof TypeAbstract){
                        $fields[$key][$name] = $value->init($argument);
                    }
                }

            }
        }

        return $fields;
    }
protected function updateRelations ( array $ fields , $ argument = false ) { foreach ( $ fields as $ key => $ field ) { /** @var TypeAbstract $value */ foreach ( $ field as $ name => $ value ) { if ( $ name == 'type' ) { if ( $ value instanceof ListType ) { if ( $ value -> getItemType ( ) instanceof TypeAbstract ) { $ fields [ $ key ] [ $ name ] = new ListType ( $ value -> getItemType ( ) -> init ( $ argument ) ) ; } } if ( $ value instanceof TypeAbstract ) { $ fields [ $ key ] [ $ name ] = $ value -> init ( $ argument ) ; } } } } return $ fields ; }
Update all relation fields to argument or field. Depends on type argument

@param $fields
@param bool $argument
@return mixed
@throws \Youshido\GraphQL\Exception\ConfigurationException
Update all relation fields to argument or field . Depends on type argument