Skip to content

Can a I define a with on a Type field? #1082

Answered by mfn
larskoole asked this question in Q&A
Discussion options

You must be logged in to vote

Basically the way the underlying graphql-php library suggests it, see https://webonyx.github.io/graphql-php/data-fetching/#solving-n1-problem

The realization to start returning new Deferred() with a closure from a resolver is key to achive the lazy-eager-loading correctly.

A commonly used library is https://github.com/overblog/dataloader-php but I found it better in my project to use a custom implementation.

Replies: 1 comment 4 replies

Comment options

mfn
Aug 9, 2023
Collaborator

You must be logged in to vote
4 replies
@larskoole
Comment options

@mfn
Comment options

mfn Aug 9, 2023
Collaborator

@larskoole
Comment options

@mfn
Comment options

mfn Aug 10, 2023
Collaborator

Answer selected by larskoole
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants