query GetSessionAndUser($sessionToken: String!) {
  sessions(where: { sessionToken: { _eq: $sessionToken } }) {
    ...Session
    user {
      ...User
    }
  }
}

query GetSession($sessionToken: String!) {
  sessions_by_pk(sessionToken: $sessionToken) {
    ...Session
  }
}

mutation CreateSession($data: sessions_insert_input!) {
  insert_sessions_one(object: $data) {
    ...Session
  }
}

mutation UpdateSession($sessionToken: String, $data: sessions_set_input!) {
  update_sessions(
    where: { sessionToken: { _eq: $sessionToken } }
    _set: $data
  ) {
    returning {
      ...Session
    }
  }
}

mutation DeleteSession($sessionToken: String!) {
  delete_sessions(where: { sessionToken: { _eq: $sessionToken } }) {
    returning {
      ...Session
    }
  }
}
