Skip to content

TypeScript problem when using Metafield type with MediaImage reference. #2196

Answered by frehner
ramiroazar asked this question in Help
Discussion options

You must be logged in to vote

In this type of situation, I would say that trying to build your own Storefront API TypeScript type is kind of a code-smell; if you're not transforming the Storefront API response in any way, then your TS type for it should be the exact type that we provide.

In order to best help you, it would help if we could see your exact query. But if you say it's similar to what you linked above, then you'll find that the metafield will be on product.metafield and not product.image.

But it's all hard to say without seeing a concrete example.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ramiroazar
Comment options

@frehner
Comment options

@ramiroazar
Comment options

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