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

Function squadIntelQueryOptions

packages/shared/src/graphql/squadIntel.ts:126–147  ·  view source on GitHub ↗
({
  user,
  sourceId,
  enabled = true,
}: {
  user?: Pick<LoggedUser, 'id'>;
  sourceId?: string;
  enabled?: boolean;
})

Source from the content-addressed store, hash-verified

124});
125
126export const squadIntelQueryOptions = ({
127 user,
128 sourceId,
129 enabled = true,
130}: {
131 user?: Pick<LoggedUser, 'id'>;
132 sourceId?: string;
133 enabled?: boolean;
134}) => ({
135 queryKey: generateQueryKey(RequestKey.SquadIntel, user, sourceId),
136 queryFn: async (): Promise<SquadIntel | null> => {
137 const res = await gqlClient.request<{ squadIntel: SquadIntel | null }>(
138 SQUAD_INTEL_QUERY,
139 { sourceId },
140 );
141
142 return res.squadIntel;
143 },
144 enabled: enabled && !!user?.id && !!sourceId,
145 staleTime: StaleTime.Default,
146 retry: false,
147});
148
149export const updateSquadIntelSettings = async ({
150 sourceId,

Callers 5

seedFunction · 0.90
seedFunction · 0.90
SquadIntelPageFunction · 0.90
openIntelFunction · 0.90
SquadManageIntelFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by 1

openIntelFunction · 0.72