Skip to content

Commit

Permalink
fix(core): Correctly resolve deprecated asset fields in search query
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Feb 19, 2020
1 parent 2907b08 commit e9a517b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/src/api/middleware/asset-interceptor-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ export class AssetInterceptorPlugin implements ApolloServerPlugin {
value.productVariantAsset.preview,
);
}
// TODO: This path is deprecated and should be removed in a future version
// once the fields are removed from the GraphQL API
if (value.productPreview) {
value.productPreview = toAbsoluteUrl(request, value.productPreview);
}
if (value.productVariantPreview) {
value.productVariantPreview = toAbsoluteUrl(request, value.productVariantPreview);
}
}
}
return value;
Expand Down

0 comments on commit e9a517b

Please sign in to comment.