Skip to content

is_leaf_type() returns True when the type is List of String #105

Closed
@obi1kenobi

Description

@obi1kenobi
In [1]: from graphql import GraphQLString, GraphQLList

In [2]: from graphql.type.definition import is_leaf_type

In [3]: is_leaf_type(GraphQLList(GraphQLString))
Out[3]: True

See the current master implementation here: is_leaf_type() calls get_named_type(), which unwinds both lists and non-nulls to get at the inner type. The list unwinding is incorrect in this instance, as a list of strings is clearly a non-leaf type.

This is all using graphql-core version 1.0.1, the newest available on PyPI.

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