MCPcopy Create free account
hub / github.com/dailydotdev/apps / squadProductsQueryOptions

Function squadProductsQueryOptions

packages/shared/src/graphql/squadProducts.ts:60–77  ·  view source on GitHub ↗
({
  squad,
  user,
}: {
  squad?: Pick<Squad, 'handle' | 'features'>;
  user?: Pick<LoggedUser, 'id'>;
})

Source from the content-addressed store, hash-verified

58`;
59
60export const squadProductsQueryOptions = ({
61 squad,
62 user,
63}: {
64 squad?: Pick<Squad, 'handle' | 'features'>;
65 user?: Pick<LoggedUser, 'id'>;
66}) => ({
67 queryKey: generateQueryKey(RequestKey.Squad, user, squad?.handle, 'products'),
68 queryFn: async (): Promise<SquadProduct[]> => {
69 const res = await gqlClient.request<{
70 source: { products: SquadProduct[] };
71 }>(SQUAD_PRODUCTS_QUERY, { handle: squad?.handle });
72
73 return res.source.products;
74 },
75 enabled: !!squad?.handle && !!squad?.features?.products,
76 staleTime: StaleTime.Default,
77});
78
79export interface SquadProductInput {
80 tagline: string | null;

Callers 9

seedFunction · 0.90
seedFunction · 0.90
seedFunction · 0.90
seedFunction · 0.90
SetupPreviewFunction · 0.90
useCompanyPageReadinessFunction · 0.90
useStartupsSetupProgressFunction · 0.90
useSquadProductMutationsFunction · 0.90
useSquadProductsFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected