Centralized graph files (hooks/graph/*.ts) define GraphQL queries consumed by multiple page components. This architecture intentionally separates field definitions from usage, triggering relay/unused-fields and relay/must-colocate-fragment-spreads. File-level eslint-disable comments suppress these false positives. Also adds explicit TypeScript generics to useMutation and usePaginationFragment calls to satisfy relay/generated-typescript-types without eslint-disable. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
119 lines
2.1 KiB
TypeScript
119 lines
2.1 KiB
TypeScript
import { graphql } from "relay-runtime";
|
|
|
|
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
|
|
|
// Queries for custom domain (subdomain) approach
|
|
export const currentTrustGraphQuery = graphql`
|
|
query TrustGraphCurrentQuery {
|
|
viewer {
|
|
id
|
|
}
|
|
currentTrustCenter @required(action: THROW) {
|
|
id
|
|
slug
|
|
viewerSubscription {
|
|
id
|
|
email
|
|
createdAt
|
|
updatedAt
|
|
}
|
|
logoFileUrl
|
|
darkLogoFileUrl
|
|
nonDisclosureAgreement {
|
|
fileName
|
|
fileUrl
|
|
viewerSignature {
|
|
status
|
|
}
|
|
}
|
|
organization {
|
|
name
|
|
description
|
|
websiteUrl
|
|
email
|
|
headquarterAddress
|
|
}
|
|
externalUrls(first: 20) {
|
|
edges {
|
|
node {
|
|
id
|
|
name
|
|
url
|
|
}
|
|
}
|
|
}
|
|
...OverviewPageFragment
|
|
vendorInfo: vendors(first: 0) {
|
|
totalCount
|
|
}
|
|
audits(first: 50) {
|
|
edges {
|
|
node {
|
|
id
|
|
...AuditRowFragment
|
|
}
|
|
}
|
|
}
|
|
complianceFrameworks(first: 50) {
|
|
edges {
|
|
node {
|
|
id
|
|
framework {
|
|
...FrameworkBadgeFragment
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const currentTrustDocumentsQuery = graphql`
|
|
query TrustGraphCurrentDocumentsQuery {
|
|
currentTrustCenter {
|
|
id
|
|
organization {
|
|
name
|
|
}
|
|
documents(first: 50) {
|
|
edges {
|
|
node {
|
|
id
|
|
documentType
|
|
...DocumentRowFragment
|
|
}
|
|
}
|
|
}
|
|
trustCenterFiles(first: 50) {
|
|
edges {
|
|
node {
|
|
id
|
|
category
|
|
...TrustCenterFileRowFragment
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const currentTrustVendorsQuery = graphql`
|
|
query TrustGraphCurrentVendorsQuery {
|
|
currentTrustCenter {
|
|
id
|
|
organization {
|
|
name
|
|
}
|
|
vendors(first: 50) {
|
|
edges {
|
|
node {
|
|
id
|
|
countries
|
|
...VendorRowFragment
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|