enum VIEW {
  SIGN_UP
  SIGN_IN
  FORGOT_PASSWORD
}

enum TAB {
  COMMENTS
  PROFILE
}

enum PROFILE_TAB {
  MY_COMMENTS
  ACCOUNT
  NOTIFICATIONS
}

enum COMMENTS_TAB {
  """
  NONE is used before the active tab can be determined. The active tab is
  determined after we count how many featured comments there are.
  """
  NONE
  FEATURED_COMMENTS
  ALL_COMMENTS
}

enum COMMENT_VIEWER_ACTION {
  EDIT
  APPROVE
  REJECT
}

type AuthPopup {
  open: Boolean!
  focus: Boolean!
  view: VIEW
}

extend type Comment {
  # pending is true during the optimistic response.
  pending: Boolean
  # localReplies contains only comments created by the user
  # on the ultimate threading level.
  localReplies: [Comment!]

  # Remember last viewer action that could have caused a status change.
  lastViewerAction: COMMENT_VIEWER_ACTION

  # If true then Comment came in live.
  enteredLive: Boolean
}

extend type CommentsConnection {
  # Contains comment that came in live and is still behind the `View New` button.
  viewNewEdges: [CommentEdge!]
}

type Local {
  accessToken: String
  accessTokenExp: Int
  accessTokenJTI: String
  activeTab: TAB!
  authPopup: AuthPopup!
  storyID: String
  storyURL: String
  commentID: String
  commentsOrderBy: COMMENT_SORT!
  profileTab: PROFILE_TAB!
  commentsTab: COMMENTS_TAB!
}

extend type Query {
  local: Local!
}
