Skip to content

Commit

Permalink
chore: schema updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sandipndev committed May 14, 2024
1 parent b9dc0b7 commit d1da5ca
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
14 changes: 2 additions & 12 deletions app/graphql/generated.gql
Original file line number Diff line number Diff line change
Expand Up @@ -791,16 +791,6 @@ query Bulletins($first: Int!, $after: String) {
startCursor
__typename
}
nodes {
id
title
body
deepLink
createdAt
acknowledgedAt
bulletinEnabled
__typename
}
edges {
node {
id
Expand Down Expand Up @@ -902,7 +892,7 @@ query SettingsScreen {

query StatefulNotifications($after: String) {
me {
statefulNotifications(first: 10, after: $after) {
statefulNotificationsWithoutBulletinEnabled(first: 10, after: $after) {
nodes {
id
title
Expand All @@ -929,7 +919,7 @@ query StatefulNotifications($after: String) {
query UnacknowledgedNotificationCount {
me {
id
unacknowledgedStatefulNotificationsCount
unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount
__typename
}
}
Expand Down
31 changes: 15 additions & 16 deletions app/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2173,11 +2173,12 @@ export type User = {
/** Phone number with international calling code. */
readonly phone?: Maybe<Scalars['Phone']['output']>;
readonly statefulNotifications: StatefulNotificationConnection;
readonly statefulNotificationsWithoutBulletinEnabled: StatefulNotificationConnection;
readonly supportChat: ReadonlyArray<SupportMessage>;
/** 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
Expand All @@ -2197,6 +2198,12 @@ export type UserStatefulNotificationsArgs = {
};


export type UserStatefulNotificationsWithoutBulletinEnabledArgs = {
after?: InputMaybe<Scalars['String']['input']>;
first: Scalars['Int']['input'];
};


export type UserUnacknowledgedStatefulNotificationsWithBulletinEnabledArgs = {
after?: InputMaybe<Scalars['String']['input']>;
first: Scalars['Int']['input'];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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; }>;

Expand Down Expand Up @@ -3356,15 +3363,6 @@ export const BulletinsDocument = gql`
hasPreviousPage
startCursor
}
nodes {
id
title
body
deepLink
createdAt
acknowledgedAt
bulletinEnabled
}
edges {
node {
id
Expand Down Expand Up @@ -4890,7 +4888,7 @@ export type BusinessMapMarkersQueryResult = Apollo.QueryResult<BusinessMapMarker
export const StatefulNotificationsDocument = gql`
query StatefulNotifications($after: String) {
me {
statefulNotifications(first: 10, after: $after) {
statefulNotificationsWithoutBulletinEnabled(first: 10, after: $after) {
nodes {
id
title
Expand Down Expand Up @@ -7335,7 +7333,7 @@ export const UnacknowledgedNotificationCountDocument = gql`
query UnacknowledgedNotificationCount {
me {
id
unacknowledgedStatefulNotificationsCount
unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount
}
}
`;
Expand Down Expand Up @@ -9484,10 +9482,11 @@ export type UserResolvers<ContextType = any, ParentType extends ResolversParentT
language?: Resolver<ResolversTypes['Language'], ParentType, ContextType>;
phone?: Resolver<Maybe<ResolversTypes['Phone']>, ParentType, ContextType>;
statefulNotifications?: Resolver<ResolversTypes['StatefulNotificationConnection'], ParentType, ContextType, RequireFields<UserStatefulNotificationsArgs, 'first'>>;
statefulNotificationsWithoutBulletinEnabled?: Resolver<ResolversTypes['StatefulNotificationConnection'], ParentType, ContextType, RequireFields<UserStatefulNotificationsWithoutBulletinEnabledArgs, 'first'>>;
supportChat?: Resolver<ReadonlyArray<ResolversTypes['SupportMessage']>, ParentType, ContextType>;
totpEnabled?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
unacknowledgedStatefulNotificationsCount?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
unacknowledgedStatefulNotificationsWithBulletinEnabled?: Resolver<ResolversTypes['StatefulNotificationConnection'], ParentType, ContextType, RequireFields<UserUnacknowledgedStatefulNotificationsWithBulletinEnabledArgs, 'first'>>;
unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
username?: Resolver<Maybe<ResolversTypes['Username']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions app/screens/settings-screen/settings-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ gql`
query UnacknowledgedNotificationCount {
me {
id
unacknowledgedStatefulNotificationsCount
unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount
}
}
Expand Down Expand Up @@ -100,7 +100,8 @@ export const SettingsScreen: React.FC = () => {

useEffect(() => {
const count =
unackNotificationCount?.me?.unacknowledgedStatefulNotificationsCount || 0
unackNotificationCount?.me
?.unacknowledgedStatefulNotificationsWithoutBulletinEnabledCount || 0
navigation.setOptions({
headerRight: () => (
<TouchableOpacity onPress={() => navigation.navigate("notificationHistory")}>
Expand Down

0 comments on commit d1da5ca

Please sign in to comment.