Skip to content

Able to use non input type as input type when wrapped in GraphQLList #2656

@CNAChino

Description

@CNAChino

Describe the bug
The issue occurs when using GraphQLArgument builder with type as GraphQLList(an instance of GraphQLInputType) and wraps a non-input type like GraphQLObjectType.

Was also able to build a schema as shown in the following code.

To Reproduce

GraphQLObjectType graphQLObjectType = GraphQLObjectType.newObject().name("ObjectTypeA").build();

    GraphQLArgument argument = GraphQLArgument.newArgument()
        .name("testArg")
        .type(GraphQLList.list(graphQLObjectType))
        .build();

    GraphQLObjectType queryObject = GraphQLObjectType.newObject()
        .name("Query")
        .field(GraphQLFieldDefinition.newFieldDefinition()
            .name("testField")
            .argument(argument)
            .type(graphQLObjectType)
            .build())
        .build();

    GraphQLSchema schema = GraphQLSchema.newSchema()
        .query(queryObject)
        .additionalTypes(Collections.emptySet())
        .additionalDirectives(Collections.emptySet())
        .build();

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