Skip to content

Impossibility to return a Deferred Array #187

@bmfs

Description

@bmfs

I'm making use of the webonyx/graphql-php Deferred type as I find them more intuitive to use than the prefetch option.

However I'm having trouble returning an Deferred type in a field which is supposed to be an array.

As a temporary solution, I'm returning an Array of Deferred, but I find this suboptimal, has the deferred value could resolve to null, and I would end up with null values in an array.

Is it possible to return a Deferred Array?

An example schema would be:

type Purchase {
   id: ID!
   item: [PurchaseItem]
}

type PurchaseItem {
    product_id: String
    quantity: Int
}

In this scenario, I want want to defer the resolution of Purchase.item.

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