Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
patch: Filter user channels with memberships count (#496)
Browse files Browse the repository at this point in the history
Currently there is a problem when removing channel. We get `membership` of length less than 2 which does not return user when rendering channels.

We can filter the channel on the server side to avoid current situation.

- Regenerated schema and typings.
- Update channel tests
  • Loading branch information
hyochan authored Oct 3, 2021
1 parent 04cbf59 commit 114f575
Show file tree
Hide file tree
Showing 25 changed files with 549 additions and 466 deletions.
84 changes: 38 additions & 46 deletions client/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,22 @@ type AuthPayload {
user: User!
}

enum AuthType {
email
facebook
google
apple
}

type BlockedUser {
createdAt: DateTime
updatedAt: DateTime
deletedAt: DateTime
createdAt: Date
updatedAt: Date
deletedAt: Date
user: User
blockedUser: User
}

type Channel {
id: String!
channelType: ChannelType!
id: ID!
channelType: ChannelType
name: String
lastMessageId: String
createdAt: DateTime
updatedAt: DateTime
deletedAt: DateTime
createdAt: Date
updatedAt: Date
deletedAt: Date

"""Get latest message sent to the channel."""
lastMessage: Message
Expand Down Expand Up @@ -94,12 +87,10 @@ representation of dates and times using the Gregorian calendar.
"""
scalar Date

scalar DateTime

type Friend {
createdAt: DateTime
updatedAt: DateTime
deletedAt: DateTime
createdAt: Date
updatedAt: Date
deletedAt: Date
user: User
friend: User
}
Expand All @@ -109,24 +100,24 @@ scalar Gender
type Membership {
alertMode: AlertMode
membershipType: MembershipType
isVisible: Boolean!
createdAt: DateTime
updatedAt: DateTime
isVisible: Boolean
createdAt: Date
updatedAt: Date
user: User
channel: Channel
}

scalar MembershipType

type Message {
id: String!
id: ID!
messageType: MessageType!
text: String
imageUrls: [String]
fileUrls: [String]
createdAt: DateTime
updatedAt: DateTime
deletedAt: DateTime
createdAt: Date
updatedAt: Date
deletedAt: Date
channel: Channel
sender: User
replies: [Reply]
Expand Down Expand Up @@ -227,8 +218,7 @@ type Notification {
token: String!
device: String
os: String
user: User!
createdAt: DateTime
createdAt: Date
}

"""
Expand Down Expand Up @@ -258,7 +248,8 @@ type PageInfo {

type Profile {
socialId: String
authType: AuthType
authType: Auth
user: User
}

type Query {
Expand Down Expand Up @@ -347,27 +338,28 @@ type Query {
}

type Reaction {
id: Int!
id: ID!
value: String!
}

type Reply {
id: Int!
id: ID!
messageType: MessageType!
text: String
imageUrls: [String!]!
fileUrls: [String!]!
createdAt: DateTime
updatedAt: DateTime
deletedAt: DateTime
imageUrls: [String]
fileUrls: [String]
createdAt: Date
updatedAt: Date
deletedAt: Date
sender: User!
}

type Report {
id: ID!
report: String!
createdAt: DateTime
updatedAt: DateTime
deletedAt: DateTime
createdAt: Date
updatedAt: Date
deletedAt: Date
user: User
reportedUser: User
}
Expand All @@ -382,23 +374,23 @@ type Subscription {
scalar Upload

type User {
id: String!
id: ID!
email: String
name: String
nickname: String
thumbURL: String
photoURL: String
birthday: DateTime
birthday: Date
gender: Gender
phone: String
statusMessage: String
verified: Boolean
lastSignedIn: DateTime
lastSignedIn: Date
isOnline: Boolean
createdAt: Date
updatedAt: Date
deletedAt: Date
profile: Profile
createdAt: DateTime
updatedAt: DateTime
deletedAt: DateTime
notifications: [Notification]

"""Check if the user is blocked by the user who have signed in."""
Expand Down
3 changes: 1 addition & 2 deletions client/src/__generated__/AuthProviderMeQuery.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 114f575

Please sign in to comment.