-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossibility to return a Deferred Array #187
Comments
Oh! It never occured to me that you could return a Indeed, the "prefetch" option is supposed to be used in those cases (I always thought this was the only option and never realized you could do this with a Out of curiosity, what syntax would you like to use (in an ideal world) to declare an array of deferred? |
Ah :) Yeap, It works great. At least never noticed a problem until now. In the ideal world I wouldn't need to do anything. Internally, it would check if it was a deferred and post pone the validation and any further work. |
Is this really something we should be considering as part of this lib? How would |
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:
In this scenario, I want want to defer the resolution of Purchase.item.
The text was updated successfully, but these errors were encountered: