Skip to content

Struggling with types #2458

Closed Answered by renatodex
renatodex asked this question in Help
Discussion options

You must be logged in to vote

Okay, I've figured by myself.
This is the code that solved the problem:

const PRODUCT_IMAGE_FRAGMENT = `#graphql
  fragment ProductMediaImage on MediaImage {
    __typename
    mediaContentType
    image {
      __typename
      id
      url
      altText
      width
      height
    }
  }
` as const;

const PRODUCT_EXTERNAL_VIDEO_FRAGMENT = `#graphql
  fragment ProductExternalVideo on ExternalVideo {
    mediaContentType
    id
    embedUrl
    host
    originUrl
    presentation {
      id
    }
    previewImage {
      id
      url
      width
      height
      altText
    }
  }
` as const;

const PRODUCT_VIDEO_FRAGMENT = `#graphql
  fragment ProductVideo on Video {
    id
    mediaCo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by renatodex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant