Skip to content

listOf() and Schema() don't accept lazy loading types? #779

@mikespub

Description

@mikespub

I was experimenting with lazy loading types again after discovering #557 (query typeloader doc only confused the matter, sorry), and I was happy to find that it worked well - handy when you're trying to return cached query results, and you only want to load the relevant types in the schema to figure out the queryPlan.

Anyway, I did notice that listOf(...lazy type...); was not working at the moment:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to GraphQL\\Type\\Definition\\Type::listOf() must be an instance of GraphQL\\Type\\Definition\\Type, instance of Closure given

And it seems you can't pass a Closure as a lazy loaded query type in Schema() either:

PHP Fatal error:  Uncaught Error: Closure object cannot have properties in vendor/webonyx/graphql-php/src/Type/Schema.php:138

Any of this sound familiar?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions