fix: immutable extractNodes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Helper: Extracts nodes from a GraphQL connection object, returning an empty array if nodes are absent.
|
||||
export function extractNodes<T>(connection: { nodes?: T[] } | null | undefined): T[] {
|
||||
return connection?.nodes || [] as T[];
|
||||
export function extractNodes<T>(connection: { nodes?: readonly T[] } | null | undefined): readonly T[] {
|
||||
return connection?.nodes ?? [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user