Skip to content

Allow deprecation of input values (arguments and input fields) #110

Closed
@simPod

Description

@simPod

I haven't find anything about it in gql specs. Am I missing something?

private static function printInputObject(InputObjectType $type)
    {
        $fields = array_values($type->getFields());
        return self::printDescription($type) . 
            "input {$type->name} {\n" .
                implode("\n", array_map(function($f, $i) {
                    return self::printDescription($f, '  ', !$i) . '  ' . self::printInputValue($f);
                }, $fields, array_keys($fields))) . "\n" .
            "}";
    }

doesn't print deprecation reason vs

private static function printObject(ObjectType $type)
    {
        $interfaces = $type->getInterfaces();
        $implementedInterfaces = !empty($interfaces) ?
            ' implements ' . implode(', ', array_map(function($i) {
                return $i->name;
            }, $interfaces)) : '';
        return self::printDescription($type) .
            "type {$type->name}$implementedInterfaces {\n" .
                self::printFields($type) . "\n" .
            "}";
    }

private static function printFields($type)
    {
        $fields = array_values($type->getFields());
        return implode("\n", array_map(function($f, $i) {
                return self::printDescription($f, '  ', !$i) . '  ' .
                    $f->name . self::printArgs($f->args, '  ') . ': ' .
                    (string) $f->getType() . self::printDeprecated($f);
            }, $fields, array_keys($fields)));
    }

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions