fragment URLFragment on URL {
  url
  type
}

fragment ImageFragment on Image {
  id
  url
  width
  height
}

fragment StudioFragment on Studio {
  name
  id
  aliases
  urls {
    ...URLFragment
  }
  parent {
    name
    id
  }
  images {
    ...ImageFragment
  }
}

fragment TagFragment on Tag {
  name
  id
  description
  aliases
  category {
    id
    name
    description
  }
}

fragment MeasurementsFragment on Measurements {
  band_size
  cup_size
  waist
  hip
}

fragment BodyModificationFragment on BodyModification {
  location
  description
}

fragment PerformerFragment on Performer {
  id
  name
  disambiguation
  aliases
  gender
  merged_ids
  deleted
  merged_into_id
  urls {
    ...URLFragment
  }
  images {
    ...ImageFragment
  }
  birth_date
  death_date
  ethnicity
  country
  eye_color
  hair_color
  height
  measurements {
    ...MeasurementsFragment
  }
  breast_type
  career_start_year
  career_end_year
  tattoos {
    ...BodyModificationFragment
  }
  piercings {
    ...BodyModificationFragment
  }
}

fragment PerformerAppearanceFragment on PerformerAppearance {
  as
  performer {
    ...PerformerFragment
  }
}

fragment FingerprintFragment on Fingerprint {
  algorithm
  hash
  duration
}

fragment SceneFragment on Scene {
  id
  title
  code
  details
  director
  duration
  date
  urls {
    ...URLFragment
  }
  images {
    ...ImageFragment
  }
  studio {
    ...StudioFragment
  }
  tags {
    ...TagFragment
  }
  performers {
    ...PerformerAppearanceFragment
  }
  fingerprints {
    ...FingerprintFragment
  }
}

query FindScenesBySceneFingerprints(
  $fingerprints: [[FingerprintQueryInput!]!]!
) {
  findScenesBySceneFingerprints(fingerprints: $fingerprints) {
    ...SceneFragment
  }
}

query SearchScene($term: String!) {
  searchScene(term: $term) {
    ...SceneFragment
  }
}

query SearchPerformer($term: String!) {
  searchPerformer(term: $term) {
    ...PerformerFragment
  }
}

query FindPerformerByID($id: ID!) {
  findPerformer(id: $id) {
    ...PerformerFragment
  }
}

query FindSceneByID($id: ID!) {
  findScene(id: $id) {
    ...SceneFragment
  }
}

query FindStudio($id: ID, $name: String) {
  findStudio(id: $id, name: $name) {
    ...StudioFragment
  }
}

query FindTag($id: ID, $name: String) {
  findTag(id: $id, name: $name) {
    ...TagFragment
  }
}

query QueryTags($input: TagQueryInput!) {
  queryTags(input: $input) {
    count
    tags {
      ...TagFragment
    }
  }
}

mutation SubmitFingerprint($input: FingerprintSubmission!) {
  submitFingerprint(input: $input)
}

query Me {
  me {
    name
  }
}

mutation SubmitSceneDraft($input: SceneDraftInput!) {
  submitSceneDraft(input: $input) {
    id
  }
}

mutation SubmitPerformerDraft($input: PerformerDraftInput!) {
  submitPerformerDraft(input: $input) {
    id
  }
}
