import { gql } from '@apollo/client/core';

// Real endpoints discovered in v8.11.0 - replaces old wrong guesses

export const LIKES_PROFILE_FRAGMENT = gql`
  fragment LikesProfileFragment on Profile {
    id
    age
    gender
    status
    lastSeen
    desires
    connectionGoals
    isUplift
    sexuality
    isMajestic
    dateOfBirth
    streamUserId
    imaginaryName
    bio
    hiddenBio
    hasHiddenBio
    allowPWM
    interests
    verificationStatus
    interactionStatus {
      message
      mine
      theirs
      __typename
    }
    distance {
      km
      mi
      __typename
    }
    photos {
      id
      pictureIsPrivate
      pictureIsSafe
      pictureStatus
      pictureType
      pictureUrl
      pictureUrls {
        small
        medium
        large
        __typename
      }
      publicId
      __typename
    }
    __typename
  }
`;

// pastLikes - profiles you've liked (new in v8.11.0)
export const PAST_LIKES_QUERY = gql`
  ${LIKES_PROFILE_FRAGMENT}
  query pastLikes($cursor: String, $input: PastLikesQueryInput!, $limit: Int) {
    pastLikes(cursor: $cursor, input: $input, limit: $limit) {
      nodes {
        isPing
        interactionSentAt
        profile {
          ...LikesProfileFragment
          __typename
        }
        __typename
      }
      pageInfo {
        hasNextPage
        nextPageCursor
        total
        unfilteredTotal
        __typename
      }
      __typename
    }
  }
`;

// pastDislikes - profiles you've passed (new in v8.11.0)
export const PAST_DISLIKES_QUERY = gql`
  ${LIKES_PROFILE_FRAGMENT}
  query pastDislikes($cursor: String, $input: PastDislikesQueryInput!, $limit: Int) {
    pastDislikes(cursor: $cursor, input: $input, limit: $limit) {
      nodes {
        interactionSentAt
        profile {
          ...LikesProfileFragment
          __typename
        }
        __typename
      }
      pageInfo {
        hasNextPage
        nextPageCursor
        total
        unfilteredTotal
        __typename
      }
      __typename
    }
  }
`;
