Skip to content

Commit

Permalink
fix: add missing tags for listen queries (#8595)
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 authored Feb 11, 2025
1 parent b229295 commit e9d9b1f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const LISTEN_OPTIONS: ListenOptions = {
events: ['welcome', 'mutation', 'reconnect'],
includeResult: true,
visibility: 'query',
tag: 'comments-store',
}

export const SORT_FIELD = '_createdAt'
Expand Down
1 change: 1 addition & 0 deletions packages/sanity/src/core/tasks/store/useTasksStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const LISTEN_OPTIONS: ListenOptions = {
events: ['welcome', 'mutation', 'reconnect'],
includeResult: true,
visibility: 'query',
tag: 'tasks-store',
}

export const SORT_FIELD = '_createdAt'
Expand Down
1 change: 1 addition & 0 deletions packages/sanity/src/presentation/useDocumentLocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function listen(id: string, fields: string[], store: DocumentStore) {
const params = {id, draftId: getDraftId(id)}
return store.listenQuery(query, params, {
perspective: 'drafts',
tag: 'drafts',
}) as Observable<SanityDocument | null>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function listenSearchQuery(options: ListenQueryOptions): Observable<Searc
events: ['welcome', 'mutation', 'reconnect'],
includeResult: false,
visibility: 'query',
tag: 'listen-search-query',
})
}).pipe(
mergeMap((ev, i) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const LISTEN_OPTIONS: ListenOptions = {
events: ['welcome', 'mutation', 'reconnect'],
includeResult: true,
visibility: 'query',
tag: 'document-sheet-list-store',
}

/**
Expand Down

0 comments on commit e9d9b1f

Please sign in to comment.