query getLibraryItem($slug: String, $language_code: String) {
  libraryItems(filters: { slug: { eq: $slug } }) {
    data {
      id
      attributes {
        title
        subtitle
        slug
        root_item
        primary
        digital
        thumbnail {
          data {
            attributes {
              ...uploadImage
            }
          }
        }
        gallery {
          data {
            id
            attributes {
              ...uploadImage
            }
          }
        }
        release_date {
          ...datePicker
        }
        price {
          ...pricePicker
        }
        categories(pagination: { limit: -1 }) {
          data {
            id
            attributes {
              name
              short
            }
          }
        }
        urls(pagination: { limit: -1 }) {
          url
        }
        size {
          width
          height
          thickness
        }
        descriptions(pagination: { limit: -1 }) {
          description
        }
        metadata {
          __typename
          ... on ComponentMetadataBooks {
            subtype {
              data {
                attributes {
                  slug
                  titles(filters: { language: { code: { eq: $language_code } } }) {
                    title
                  }
                }
              }
            }
            binding_type
            page_count
            page_order
            languages(pagination: { limit: -1 }) {
              data {
                attributes {
                  code
                  name
                }
              }
            }
          }
          ... on ComponentMetadataVideo {
            subtype {
              data {
                attributes {
                  slug
                  titles(filters: { language: { code: { eq: $language_code } } }) {
                    title
                  }
                }
              }
            }
          }
          ... on ComponentMetadataGame {
            platforms(pagination: { limit: -1 }) {
              data {
                id
                attributes {
                  short
                }
              }
            }
            audio_languages(pagination: { limit: -1 }) {
              data {
                attributes {
                  code
                  name
                }
              }
            }
            sub_languages(pagination: { limit: -1 }) {
              data {
                attributes {
                  code
                  name
                }
              }
            }
            interface_languages(pagination: { limit: -1 }) {
              data {
                attributes {
                  code
                  name
                }
              }
            }
          }
          ... on ComponentMetadataAudio {
            subtype {
              data {
                attributes {
                  slug
                  titles(filters: { language: { code: { eq: $language_code } } }) {
                    title
                  }
                }
              }
            }
          }
          ... on ComponentMetadataGroup {
            subtype {
              data {
                attributes {
                  slug
                  titles(filters: { language: { code: { eq: $language_code } } }) {
                    title
                  }
                }
              }
            }
            subitems_type {
              data {
                attributes {
                  slug
                  titles(filters: { language: { code: { eq: $language_code } } }) {
                    title
                  }
                }
              }
            }
          }
        }
        subitem_of {
          data {
            id
            attributes {
              title
              subtitle
              slug
            }
          }
        }
        subitems {
          data {
            id
            attributes {
              title
              subtitle
              slug
              thumbnail {
                data {
                  attributes {
                    ...uploadImage
                  }
                }
              }
              release_date {
                ...datePicker
              }
              price {
                ...pricePicker
              }
              categories(pagination: { limit: -1 }) {
                data {
                  id
                  attributes {
                    name
                    short
                  }
                }
              }
              metadata {
                __typename
                ... on ComponentMetadataBooks {
                  subtype {
                    data {
                      attributes {
                        slug
                        titles(filters: { language: { code: { eq: $language_code } } }) {
                          title
                        }
                      }
                    }
                  }
                }
                ... on ComponentMetadataGame {
                  platforms {
                    data {
                      id
                      attributes {
                        short
                      }
                    }
                  }
                }
                ... on ComponentMetadataVideo {
                  subtype {
                    data {
                      attributes {
                        slug
                        titles(filters: { language: { code: { eq: $language_code } } }) {
                          title
                        }
                      }
                    }
                  }
                }
                ... on ComponentMetadataAudio {
                  subtype {
                    data {
                      attributes {
                        slug
                        titles(filters: { language: { code: { eq: $language_code } } }) {
                          title
                        }
                      }
                    }
                  }
                }
                ... on ComponentMetadataGroup {
                  subtype {
                    data {
                      attributes {
                        slug
                        titles(filters: { language: { code: { eq: $language_code } } }) {
                          title
                        }
                      }
                    }
                  }
                  subitems_type {
                    data {
                      attributes {
                        slug
                        titles(filters: { language: { code: { eq: $language_code } } }) {
                          title
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        submerchs(pagination: { limit: -1 }) {
          data {
            id
            attributes {
              slug
              title
              subtitle
              thumbnail {
                data {
                  attributes {
                    ...uploadImage
                  }
                }
              }
            }
          }
        }
        contents(pagination: { limit: -1 }) {
          data {
            id
            attributes {
              slug
              range {
                __typename
                ... on ComponentRangePageRange {
                  starting_page
                  ending_page
                }
                ... on ComponentRangeTimeRange {
                  starting_time
                  ending_time
                }
              }
              scan_set {
                id
              }
              content {
                data {
                  attributes {
                    slug
                    categories(pagination: { limit: -1 }) {
                      data {
                        id
                        attributes {
                          name
                          short
                        }
                      }
                    }
                    type {
                      data {
                        attributes {
                          slug
                          titles(filters: { language: { code: { eq: $language_code } } }) {
                            title
                          }
                        }
                      }
                    }
                    translations(pagination: { limit: -1 }) {
                      language {
                        data {
                          attributes {
                            code
                          }
                        }
                      }
                      pre_title
                      title
                      subtitle
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}