From d1da5ca29dc4dc446229fef481c7bb610c89c291 Mon Sep 17 00:00:00 2001 From: sandipndev Date: Tue, 14 May 2024 09:36:02 +0530 Subject: [PATCH] chore: schema updates --- app/graphql/generated.gql | 14 ++------- app/graphql/generated.ts | 31 +++++++++---------- .../notification-history-screen.tsx | 4 +-- .../settings-screen/settings-screen.tsx | 5 +-- 4 files changed, 22 insertions(+), 32 deletions(-) diff --git a/app/graphql/generated.gql b/app/graphql/generated.gql index 86e31183a5..4f2889f4b0 100644 --- a/app/graphql/generated.gql +++ b/app/graphql/generated.gql @@ -791,16 +791,6 @@ query Bulletins($first: Int!, $after: String) { startCursor __typename } - nodes { - id - title - body - deepLink - createdAt - acknowledgedAt - bulletinEnabled - __typename - } edges { node { id @@ -902,7 +892,7 @@ query SettingsScreen { query StatefulNotifications($after: String) { me { - statefulNotifications(first: 10, after: $after) { + statefulNotificationsWithoutBulletinEnabled(first: 10, after: $after) { nodes { id title @@ -929,7 +919,7 @@ query StatefulNotifications($after: String) { query UnacknowledgedNotificationCount { me { id - unacknowledgedStatefulNotificationsCount + unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount __typename } } diff --git a/app/graphql/generated.ts b/app/graphql/generated.ts index a05aab11ae..995dc57bfb 100644 --- a/app/graphql/generated.ts +++ b/app/graphql/generated.ts @@ -2173,11 +2173,12 @@ export type User = { /** Phone number with international calling code. */ readonly phone?: Maybe; readonly statefulNotifications: StatefulNotificationConnection; + readonly statefulNotificationsWithoutBulletinEnabled: StatefulNotificationConnection; readonly supportChat: ReadonlyArray; /** Whether TOTP is enabled for this user. */ readonly totpEnabled: Scalars['Boolean']['output']; - readonly unacknowledgedStatefulNotificationsCount: Scalars['Int']['output']; readonly unacknowledgedStatefulNotificationsWithBulletinEnabled: StatefulNotificationConnection; + readonly unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount: Scalars['Int']['output']; /** * Optional immutable user friendly identifier. * @deprecated will be moved to @Handle in Account and Wallet @@ -2197,6 +2198,12 @@ export type UserStatefulNotificationsArgs = { }; +export type UserStatefulNotificationsWithoutBulletinEnabledArgs = { + after?: InputMaybe; + first: Scalars['Int']['input']; +}; + + export type UserUnacknowledgedStatefulNotificationsWithBulletinEnabledArgs = { after?: InputMaybe; first: Scalars['Int']['input']; @@ -2495,7 +2502,7 @@ export type BulletinsQueryVariables = Exact<{ }>; -export type BulletinsQuery = { readonly __typename: 'Query', readonly me?: { readonly __typename: 'User', readonly unacknowledgedStatefulNotificationsWithBulletinEnabled: { readonly __typename: 'StatefulNotificationConnection', readonly pageInfo: { readonly __typename: 'PageInfo', readonly endCursor?: string | null, readonly hasNextPage: boolean, readonly hasPreviousPage: boolean, readonly startCursor?: string | null }, readonly nodes: ReadonlyArray<{ readonly __typename: 'StatefulNotification', readonly id: string, readonly title: string, readonly body: string, readonly deepLink?: string | null, readonly createdAt: number, readonly acknowledgedAt?: number | null, readonly bulletinEnabled: boolean }>, readonly edges: ReadonlyArray<{ readonly __typename: 'StatefulNotificationEdge', readonly cursor: string, readonly node: { readonly __typename: 'StatefulNotification', readonly id: string, readonly title: string, readonly body: string, readonly deepLink?: string | null, readonly createdAt: number, readonly acknowledgedAt?: number | null, readonly bulletinEnabled: boolean } }> } } | null }; +export type BulletinsQuery = { readonly __typename: 'Query', readonly me?: { readonly __typename: 'User', readonly unacknowledgedStatefulNotificationsWithBulletinEnabled: { readonly __typename: 'StatefulNotificationConnection', readonly pageInfo: { readonly __typename: 'PageInfo', readonly endCursor?: string | null, readonly hasNextPage: boolean, readonly hasPreviousPage: boolean, readonly startCursor?: string | null }, readonly edges: ReadonlyArray<{ readonly __typename: 'StatefulNotificationEdge', readonly cursor: string, readonly node: { readonly __typename: 'StatefulNotification', readonly id: string, readonly title: string, readonly body: string, readonly deepLink?: string | null, readonly createdAt: number, readonly acknowledgedAt?: number | null, readonly bulletinEnabled: boolean } }> } } | null }; export type BtcPriceListQueryVariables = Exact<{ range: PriceGraphRange; @@ -2695,7 +2702,7 @@ export type StatefulNotificationsQueryVariables = Exact<{ }>; -export type StatefulNotificationsQuery = { readonly __typename: 'Query', readonly me?: { readonly __typename: 'User', readonly statefulNotifications: { readonly __typename: 'StatefulNotificationConnection', readonly nodes: ReadonlyArray<{ readonly __typename: 'StatefulNotification', readonly id: string, readonly title: string, readonly body: string, readonly deepLink?: string | null, readonly createdAt: number, readonly acknowledgedAt?: number | null, readonly bulletinEnabled: boolean }>, readonly pageInfo: { readonly __typename: 'PageInfo', readonly endCursor?: string | null, readonly hasNextPage: boolean, readonly hasPreviousPage: boolean, readonly startCursor?: string | null } } } | null }; +export type StatefulNotificationsQuery = { readonly __typename: 'Query', readonly me?: { readonly __typename: 'User', readonly statefulNotificationsWithoutBulletinEnabled: { readonly __typename: 'StatefulNotificationConnection', readonly nodes: ReadonlyArray<{ readonly __typename: 'StatefulNotification', readonly id: string, readonly title: string, readonly body: string, readonly deepLink?: string | null, readonly createdAt: number, readonly acknowledgedAt?: number | null, readonly bulletinEnabled: boolean }>, readonly pageInfo: { readonly __typename: 'PageInfo', readonly endCursor?: string | null, readonly hasNextPage: boolean, readonly hasPreviousPage: boolean, readonly startCursor?: string | null } } } | null }; export type StatefulNotificationAcknowledgeMutationVariables = Exact<{ input: StatefulNotificationAcknowledgeInput; @@ -3070,7 +3077,7 @@ export type AccountDisableNotificationCategoryMutation = { readonly __typename: export type UnacknowledgedNotificationCountQueryVariables = Exact<{ [key: string]: never; }>; -export type UnacknowledgedNotificationCountQuery = { readonly __typename: 'Query', readonly me?: { readonly __typename: 'User', readonly id: string, readonly unacknowledgedStatefulNotificationsCount: number } | null }; +export type UnacknowledgedNotificationCountQuery = { readonly __typename: 'Query', readonly me?: { readonly __typename: 'User', readonly id: string, readonly unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount: number } | null }; export type SettingsScreenQueryVariables = Exact<{ [key: string]: never; }>; @@ -3356,15 +3363,6 @@ export const BulletinsDocument = gql` hasPreviousPage startCursor } - nodes { - id - title - body - deepLink - createdAt - acknowledgedAt - bulletinEnabled - } edges { node { id @@ -4890,7 +4888,7 @@ export type BusinessMapMarkersQueryResult = Apollo.QueryResult; phone?: Resolver, ParentType, ContextType>; statefulNotifications?: Resolver>; + statefulNotificationsWithoutBulletinEnabled?: Resolver>; supportChat?: Resolver, ParentType, ContextType>; totpEnabled?: Resolver; - unacknowledgedStatefulNotificationsCount?: Resolver; unacknowledgedStatefulNotificationsWithBulletinEnabled?: Resolver>; + unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount?: Resolver; username?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; diff --git a/app/screens/notification-history-screen/notification-history-screen.tsx b/app/screens/notification-history-screen/notification-history-screen.tsx index 10faaa3bc1..4148b9146d 100644 --- a/app/screens/notification-history-screen/notification-history-screen.tsx +++ b/app/screens/notification-history-screen/notification-history-screen.tsx @@ -12,7 +12,7 @@ import { Notification } from "./notification" gql` query StatefulNotifications($after: String) { me { - statefulNotifications(first: 10, after: $after) { + statefulNotificationsWithoutBulletinEnabled(first: 10, after: $after) { nodes { id title @@ -45,7 +45,7 @@ export const NotificationHistoryScreen = () => { const { data, fetchMore, refetch, loading } = useStatefulNotificationsQuery({ skip: !useIsAuthed(), }) - const notifications = data?.me?.statefulNotifications + const notifications = data?.me?.statefulNotificationsWithoutBulletinEnabled const fetchNextNotificationsPage = () => { const pageInfo = notifications?.pageInfo diff --git a/app/screens/settings-screen/settings-screen.tsx b/app/screens/settings-screen/settings-screen.tsx index c3ff8ea1bc..23748f544e 100644 --- a/app/screens/settings-screen/settings-screen.tsx +++ b/app/screens/settings-screen/settings-screen.tsx @@ -41,7 +41,7 @@ gql` query UnacknowledgedNotificationCount { me { id - unacknowledgedStatefulNotificationsCount + unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount } } @@ -100,7 +100,8 @@ export const SettingsScreen: React.FC = () => { useEffect(() => { const count = - unackNotificationCount?.me?.unacknowledgedStatefulNotificationsCount || 0 + unackNotificationCount?.me + ?.unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount || 0 navigation.setOptions({ headerRight: () => ( navigation.navigate("notificationHistory")}>