graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Nested DataLoaders are not dispatched during mutations

Open dannyheard7 opened this issue 8 months ago • 1 comments

Product

Hot Chocolate

Version

15.1.3

Link to minimal reproduction

https://github.com/dannyheard7/NestedDataLoaderNotDispatchedInMutation

Steps to reproduce

Run the application and send the following mutation:

mutation {
    addProductCatalog(input:  {
       id: 1
    })
}

What is expected?

The GetProductByIdAsync dataloader is dispatched from GetProductCatalogByIdAsync instantly

What is actually happening?

The GetProductByIdAsync never dispatches/takes a very long time to dispatch.

Additional context

The following query runs the same code, however in this case the nested data loader is dispatched instantly

query {
  productCatalog(id: 1) {
    id
  }
}

dannyheard7 avatar Apr 24 '25 10:04 dannyheard7

DataLoader nesting is not supported in Mutations. This has to do with a change we did in the executor for mutations. With V16 we will introduce a new executor for mutations.

michaelstaib avatar May 20 '25 14:05 michaelstaib