You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When an entity has an entity resolver field defined, and that field includes Assets, those Assets are not passing through the AssetInterceptor and therefore the preview and source URLs are not being correctly resolved.
To Reproduce
Add an asset to a ProductVariant in the product detail page
Save changes
Refresh page
ProductVariant image is a broken link. Does not include the prefix.
Expected behavior
ProductVariant asset urls should be correctly prefixed.
Environment (please complete the following information):
@vendure/core version: 0.1.2-beta.12
Additional context
Debugging with breakpoints shows that the sequence is as follows:
ProductService.product resolver invoked, returns a Product (without variants)
AssetInterceptor.intercept method called on the object returned in 1. And assets present are correctly prefixed.
ProductEntityResolver.variants method is called.
Response is returned without the variant assets running through the interceptor.
The text was updated successfully, but these errors were encountered:
This is a limitation of Nest - see nestjs/graphql#320. The probable solution to this is to convert the AssetInterceptor into an Apollo server plugin, which should get run on the final object just prior to returning the response to the client. This would also potentially improve performance since only the selected subset of fields may be needed to be traversed.
michaelbromley
changed the title
AssetInterceptor not running for sub-resolvers
AssetInterceptor not running for property resolvers
Aug 27, 2019
Describe the bug
When an entity has an entity resolver field defined, and that field includes Assets, those Assets are not passing through the AssetInterceptor and therefore the
preview
andsource
URLs are not being correctly resolved.To Reproduce
Expected behavior
ProductVariant asset urls should be correctly prefixed.
Environment (please complete the following information):
Additional context
Debugging with breakpoints shows that the sequence is as follows:
ProductService.product
resolver invoked, returns a Product (without variants)AssetInterceptor.intercept
method called on the object returned in 1. And assets present are correctly prefixed.ProductEntityResolver.variants
method is called.The text was updated successfully, but these errors were encountered: