export const allProductCollectionsQuery = `
  query allProductCollections(
    $filter: ProductCollectionFilterInput
  ) {
    allProductCollections(filter: $filter) {
      edges {
        node {
          nacelleEntryId
          sourceEntryId
          indexedAt
          createdAt
          updatedAt
          tags
          metafields {
            id
            namespace
            key
            value
          }
          productConnection {
            edges {
              node {
                content {
                  handle
                }
              }
            }
            pageInfo {
              hasNextPage
              endCursor
            }
          }
          content {
            collectionEntryId
            createdAt
            description
            featuredMedia {
              altText
              id
              src
              thumbnailSrc
              type
            }
            fields
            handle
            indexedAt
            locale
            metafields {
              id
              namespace
              key
              value
            }
            nacelleEntryId
            sourceEntryId
            title
            updatedAt
          }
        }
      }
      pageInfo {
        hasNextPage
        endCursor
      }
    }
  }
`;

export const allProductCollectionsProductHandlesQuery = `
  query allProductCollections(
    $filter: ProductCollectionFilterInput
    $after: String
  ) {
    allProductCollections(filter: $filter) {
      edges {
        node {
          nacelleEntryId
          productConnection(after: $after) {
            edges {
              node {
                content {
                  handle
                }
              }
            }
            pageInfo {
              hasNextPage
              endCursor
            }
          }
        }
      }
    }
  }
`;

export const allProductCollectionsProductsQuery = `
  query allProductCollections(
    $filter: ProductCollectionFilterInput
    $after: String
  ) {
    allProductCollections(filter: $filter) {
      edges {
        node {
          nacelleEntryId
          productConnection(after: $after) {
            edges {
              node {
                availableForSale
                createdAt
                nacelleEntryId
                sourceEntryId
                indexedAt
                metafields {
                  id
                  key
                  namespace
                  value
                }
                productType
                tags
                updatedAt
                vendor
                variants {
                  availableForSale
                  compareAtPrice
                  content {
                    createdAt
                    description
                    featuredMedia {
                      altText
                      id
                      mimeType
                      src
                      thumbnailSrc
                      type
                    }
                    fields
                    indexedAt
                    locale
                    media {
                      altText
                      id
                      mimeType
                      src
                      thumbnailSrc
                      type
                    }
                    metafields {
                      id
                      key
                      namespace
                      value
                    }
                    nacelleEntryId
                    productEntryId
                    productHandle
                    published
                    selectedOptions {
                      label
                      name
                      value
                    }
                    sourceEntryId
                    swatchSrc
                    title
                    updatedAt
                    variantEntryId
                  }
                  createdAt
                  indexedAt
                  metafields {
                    id
                    key
                    namespace
                    value                        
                  }
                  nacelleEntryId
                  price
                  priceCurrency
                  priceRules {
                    availableTo
                    comparedAtPrice
                    handle
                    id
                    metafields {
                      id
                      key
                      namespace
                      value
                    }
                    price
                    priceBreaks {
                      metafields {
                        id
                        key
                        namespace
                        value
                      }
                      price
                      quantityMax
                      quantityMin
                    }
                    priceCurrency
                    title
                  }
                  productEntryId
                  productHandle
                  quantityAvailable
                  sku
                  sourceEntryId
                  updatedAt
                  weight
                  weightUnit
                }
                content {
                  createdAt
                  description
                  featuredMedia {
                    altText
                    id
                    mimeType
                    src
                    thumbnailSrc
                    type
                  }
                  fields
                  handle
                  indexedAt
                  locale
                  media {
                    altText
                    id
                    mimeType
                    src
                    thumbnailSrc
                    type
                  }
                  metafields {
                    id
                    key
                    namespace
                    value
                  }
                  nacelleEntryId
                  options {
                    name
                    values
                  }
                  productEntryId
                  published
                  seo {
                    title
                    description
                  }
                  sourceEntryId
                  title
                  updatedAt
                }
              }
            }
            pageInfo {
              hasNextPage
              endCursor
            }
          }
        }
      }
    }
  }
`;
