fragment DataObjectFields on StorageDataObject {
  id
  storageBag {
    distributionBuckets {
      distributing
      operators {
        metadata {
          nodeEndpoint
        }
      }
    }
  }
}

fragment BasicChannelFields on Channel {
  id
  title
  description
  createdAt
}

fragment BasicVideoFields on Video {
  id
  title
  description
  duration
  isPublic
  isExplicit
  createdAt
  channel {
    id
    title
  }
  category {
    name
  }
  mediaMetadata {
    pixelWidth

    pixelHeight
    encoding {
      mimeMediaType
    }
  }
}

query TestQuery {
  videos(limit: 0) {
    id
  }
}

query GetChannel($id: ID!) {
  channelByUniqueInput(where: { id: $id }) {
    ...BasicChannelFields
    avatarPhoto {
      ...DataObjectFields
    }
  }
}

query GetVideo($id: ID!) {
  videoByUniqueInput(where: { id: $id }) {
    ...BasicVideoFields
    thumbnailPhoto {
      ...DataObjectFields
    }
    media {
      ...DataObjectFields
    }
  }
}
