Skip to content

DirectivesHolder does not implement toString #4190

@invliD

Description

@invliD

Describe the bug
#4027 introduced an unannounced breaking change in 25.0. Quite a few places that now contain a DirectivesHolder implicitly call toString on it in their own toString implementations. Before this change that worked just fine, because directives were just a list and lists tend to have reasonable toString implementations.

Here is one example:

public String toString() {
return "ScalarTypeDefinition{" +
"name='" + name + '\'' +
", directives=" + directives +
'}';
}

DirectivesHolder, however, does not have one, so all those other toString implementations no longer produce reasonable output.

To Reproduce
Create a ScalarTypeDefinition object. Call toString on it.

Actual output:

ScalarTypeDefinition{name='Int', directives=graphql.language.NodeUtil$DirectivesHolder@5c995dee}

Expected output (and actual output in 24.x):

ScalarTypeDefinition{name='Int', directives=[]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions