Skip to content

Commit 9373711

Browse files
committed
feat: add module to index and fix queries
1 parent ef0a87e commit 9373711

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
SystemModules,
3131
Follow,
3232
People,
33+
Notifications,
3334
} from './modules';
3435

3536
import { setContext } from '@apollo/client/link/context';
@@ -114,7 +115,7 @@ export default class KanvasCore {
114115
public companiesBranches: CompaniesBranches;
115116
public follow: Follow;
116117
public people: People;
117-
118+
public notifications: Notifications;
118119
constructor(protected options: Options) {
119120
this.client = new ApolloClient({
120121
link: this.generateLink(),
@@ -145,6 +146,7 @@ export default class KanvasCore {
145146
this.companiesBranches = new CompaniesBranches(this.client);
146147
this.follow = new Follow(this.client);
147148
this.people = new People(this.client);
149+
this.notifications = new Notifications(this.client);
148150
}
149151
protected generateURL() {
150152
return new HttpLink({ uri: this.options.url });

src/modules/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ export * from './companies';
1919
export * from './companies-branches';
2020
export * from './follows';
2121
export * from './people';
22+
export * from './notifications';

src/queries/notification.query.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export const NOTIFICATION_QUERY = gql`
66
$whereEntity: NotificationEntityFilterInput
77
$whereType: NotificationTypeFilterInput
88
$orderBy: [QueryNotificationsOrderByOrderByClause!]
9-
$first: Int!
10-
$page: Int!
9+
$first: Int
10+
$page: Int
1111
) {
1212
notifications(
1313
where: $where
@@ -19,20 +19,19 @@ export const NOTIFICATION_QUERY = gql`
1919
) {
2020
data {
2121
id
22-
user {
22+
users {
2323
id
24-
name
24+
displayname
2525
email
2626
}
2727
fromUsers {
2828
id
29-
name
29+
displayname
3030
email
3131
}
3232
companies {
3333
id
3434
name
35-
slug
3635
}
3736
systemModule {
3837
id
@@ -73,8 +72,8 @@ export const NOTIFICATION_TYPE_QUERY = gql`
7372
query notificationTypes(
7473
$where: QueryNotificationTypesWhereWhereConditions
7574
$orderBy: [QueryNotificationTypesOrderByOrderByClause!]
76-
$first: Int!
77-
$page: Int!
75+
$first: Int
76+
$page: Int
7877
) {
7978
notificationTypes(
8079
where: $where
@@ -131,8 +130,8 @@ export const NOTIFICATION_CHANNEL_QUERY = gql`
131130
query notificationChannels(
132131
$where: QueryNotificationChannelsWhereWhereConditions
133132
$orderBy: [QueryNotificationChannelsOrderByOrderByClause!]
134-
$first: Int!
135-
$page: Int!
133+
$first: Int
134+
$page: Int
136135
) {
137136
notificationChannels(
138137
where: $where
@@ -144,8 +143,6 @@ export const NOTIFICATION_CHANNEL_QUERY = gql`
144143
id
145144
name
146145
slug
147-
created_at
148-
updated_at
149146
}
150147
paginatorInfo {
151148
total

src/types/notification.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { SystemModuleInterface } from './system-module';
44

55
export interface NotificationInterface {
66
id: string;
7-
user: UserInterface;
7+
users: UserInterface;
88
fromUsers: UserInterface;
99
companies: CompanyInterface;
1010
systemModule: SystemModuleInterface;

0 commit comments

Comments
 (0)