3263 modify timeline messagingservice to allow the frontend to get multiple participants in a thread (#3611)
* wip * wip * add pagination * wip * wip * wip * update resolver * wip * wip * endpoint is working but there is still work to do * merge main * wip * subject is now first subject * number of messages is working * improving query * fix bug * fix bug * added parameter * pagination introduced a bug * pagination is working * fix type * improve typing * improve typing * fix bug * add displayName * display displayName in the frontend * move entities * fix * generate metadata * add avatarUrl * modify after comments on PR * updates * remove email mocks * remove console log * move files * remove mock * use constant * use constant * use fragments * remove console.log * generate * changes made * update DTO * generate
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const participantFragment = gql`
|
||||
fragment ParticipantFragment on TimelineThreadParticipant {
|
||||
personId
|
||||
workspaceMemberId
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
avatarUrl
|
||||
handle
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,22 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { participantFragment } from '@/activities/emails/queries/fragments/participantFragment';
|
||||
|
||||
export const timelineThreadFragment = gql`
|
||||
fragment TimelineThreadFragment on TimelineThread {
|
||||
id
|
||||
read
|
||||
firstParticipant {
|
||||
...ParticipantFragment
|
||||
}
|
||||
lastTwoParticipants {
|
||||
...ParticipantFragment
|
||||
}
|
||||
lastMessageReceivedAt
|
||||
lastMessageBody
|
||||
subject
|
||||
numberOfMessagesInThread
|
||||
participantCount
|
||||
}
|
||||
${participantFragment}
|
||||
`;
|
||||
@ -1,15 +1,20 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { timelineThreadFragment } from '@/activities/emails/queries/fragments/timelineThreadFragment';
|
||||
|
||||
export const getTimelineThreadsFromCompanyId = gql`
|
||||
query GetTimelineThreadsFromCompanyId($companyId: String!) {
|
||||
getTimelineThreadsFromCompanyId(companyId: $companyId) {
|
||||
body
|
||||
numberOfMessagesInThread
|
||||
read
|
||||
receivedAt
|
||||
senderName
|
||||
senderPictureUrl
|
||||
subject
|
||||
query GetTimelineThreadsFromCompanyId(
|
||||
$companyId: ID!
|
||||
$page: Int!
|
||||
$pageSize: Int!
|
||||
) {
|
||||
getTimelineThreadsFromCompanyId(
|
||||
companyId: $companyId
|
||||
page: $page
|
||||
pageSize: $pageSize
|
||||
) {
|
||||
...TimelineThreadFragment
|
||||
}
|
||||
}
|
||||
${timelineThreadFragment}
|
||||
`;
|
||||
|
||||
@ -1,15 +1,20 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { timelineThreadFragment } from '@/activities/emails/queries/fragments/timelineThreadFragment';
|
||||
|
||||
export const getTimelineThreadsFromPersonId = gql`
|
||||
query GetTimelineThreadsFromPersonId($personId: String!) {
|
||||
getTimelineThreadsFromPersonId(personId: $personId) {
|
||||
body
|
||||
numberOfMessagesInThread
|
||||
read
|
||||
receivedAt
|
||||
senderName
|
||||
senderPictureUrl
|
||||
subject
|
||||
query GetTimelineThreadsFromPersonId(
|
||||
$personId: ID!
|
||||
$page: Int!
|
||||
$pageSize: Int!
|
||||
) {
|
||||
getTimelineThreadsFromPersonId(
|
||||
personId: $personId
|
||||
page: $page
|
||||
pageSize: $pageSize
|
||||
) {
|
||||
...TimelineThreadFragment
|
||||
}
|
||||
}
|
||||
${timelineThreadFragment}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user