Use network only for selector queries
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -90,7 +90,7 @@ function LinkedDocumentsDialogContent(props: Omit<Props, "children">) {
|
||||
const organizationId = useOrganizationId();
|
||||
const query = useLazyLoadQuery<LinkedDocumentsDialogQuery>(documentsQuery, {
|
||||
organizationId,
|
||||
});
|
||||
}, { fetchPolicy: "network-only" });
|
||||
const { data, loadNext, hasNext, isLoadingNext } = usePaginationFragment(
|
||||
documentsFragment,
|
||||
query.organization as LinkedDocumentsDialogFragment$key
|
||||
|
||||
@@ -64,7 +64,7 @@ function AuditSelectWithQuery<T extends FieldValues = FieldValues>(
|
||||
) {
|
||||
const { __ } = useTranslate();
|
||||
const { name, organizationId, control } = props;
|
||||
const data = useLazyLoadQuery<AuditSelectFieldQuery>(auditsQuery, { organizationId });
|
||||
const data = useLazyLoadQuery<AuditSelectFieldQuery>(auditsQuery, { organizationId }, { fetchPolicy: "network-only" });
|
||||
const audits = data?.organization?.audits?.edges?.map((edge) => edge.node).filter((node) => node !== null) ?? [];
|
||||
|
||||
return (
|
||||
|
||||
@@ -89,7 +89,7 @@ export function useTrustCenterAccesses(trustCenterId: string): TrustCenterAccess
|
||||
const data = useLazyLoadQuery<TrustCenterAccessGraphQuery>(
|
||||
trustCenterAccessesQuery,
|
||||
{ trustCenterId: trustCenterId || "" },
|
||||
{ fetchPolicy: 'store-and-network' }
|
||||
{ fetchPolicy: 'network-only' }
|
||||
);
|
||||
|
||||
// Return null if trustCenterId was empty, otherwise return the data
|
||||
|
||||
@@ -49,7 +49,7 @@ const measuresFragment = graphql`
|
||||
export function usePaginatedMeasures(organizationId: string) {
|
||||
const query = useLazyLoadQuery<usePaginatedMeasuresQuery>(measuresQuery, {
|
||||
organizationId,
|
||||
});
|
||||
}, { fetchPolicy: "network-only" });
|
||||
return usePaginationFragment(
|
||||
measuresFragment,
|
||||
query.organization as usePaginatedMeasuresFragment$key
|
||||
|
||||
@@ -164,7 +164,7 @@ function FrameworkSelect({
|
||||
name: keyof FormSchema;
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
const data = useLazyLoadQuery<CreateAuditDialogFrameworksQuery>(frameworksQuery, { organizationId });
|
||||
const data = useLazyLoadQuery<CreateAuditDialogFrameworksQuery>(frameworksQuery, { organizationId }, { fetchPolicy: "network-only" });
|
||||
const frameworks = data?.organization?.frameworks?.edges?.map((edge) => edge.node).filter((node): node is NonNullable<typeof node> => node !== null) ?? [];
|
||||
|
||||
return (
|
||||
|
||||
@@ -11,7 +11,7 @@ export const trustCenterRoutes = [
|
||||
path: "trust-center",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: ({ organizationId }) =>
|
||||
loadQuery(relayEnvironment, trustCenterQuery, { organizationId }),
|
||||
loadQuery(relayEnvironment, trustCenterQuery, { organizationId }, { fetchPolicy: "network-only" }),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/trustCenter/TrustCenterPage")
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user