Add proper custom scalar type definitions

Update Relay's GraphQL scalar types by adding explicit type
definitions in package.json. This change:
- Defines custom scalar types for Datetime and CursorKey as strings
- Updates generated TypeScript files to use string types instead of any
- Improves type safety across the application by replacing any with proper types

This change provides better TypeScript type checking and reduces
implicit any usage throughout the codebase.

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-02-28 12:17:09 +01:00
parent 7329039b32
commit 367cf02e60
14 changed files with 52 additions and 48 deletions

View File

@@ -67,6 +67,10 @@
"language": "typescript",
"schema": "../../pkg/api/console/v1/schema.graphql",
"noFutureProofEnums": true,
"customScalarTypes": {
"Datetime": "string",
"CursorKey": "string"
},
"excludes": [
"**/node_modules/**",
"**/__mocks__/**",

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<09af19b5a7657e04606a42962db9db2c>>
* @generated SignedSource<<f1cdd20d14ca9fefe868019e5aa43741>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -23,7 +23,7 @@ export type ControlOverviewPageUploadEvidenceMutation$data = {
readonly uploadEvidence: {
readonly evidenceEdge: {
readonly node: {
readonly createdAt: any;
readonly createdAt: string;
readonly fileUrl: string;
readonly id: string;
readonly mimeType: string;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<fd058cd12c357b25b11a3806c359e33b>>
* @generated SignedSource<<8273f7b4bac530c828f54969eb877edb>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -26,11 +26,11 @@ export type FrameworkListPageQuery$data = {
};
}>;
};
readonly createdAt: any;
readonly createdAt: string;
readonly description: string;
readonly id: string;
readonly name: string;
readonly updatedAt: any;
readonly updatedAt: string;
};
}>;
};

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<48cb6bd6a591f9b4a0c44d3ac0b54ee4>>
* @generated SignedSource<<ef6ba4dba570cb33d84ec05b27ea18c7>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,8 +11,8 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type PeopleListPagePaginationQuery$variables = {
after?: any | null | undefined;
before?: any | null | undefined;
after?: string | null | undefined;
before?: string | null | undefined;
first?: number | null | undefined;
id: string;
last?: number | null | undefined;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<7b8897ff225dacac2f05e25136520b59>>
* @generated SignedSource<<3ec4010fd3555afec49db0fa22557dd8>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,8 +11,8 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type PeopleListPageQuery$variables = {
after?: any | null | undefined;
before?: any | null | undefined;
after?: string | null | undefined;
before?: string | null | undefined;
first?: number | null | undefined;
last?: number | null | undefined;
organizationId: string;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<4291ff1f33eb226774e68544740b4331>>
* @generated SignedSource<<f4f654235ec0210a616d4e317c3273bc>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -18,19 +18,19 @@ export type PeopleListPage_peoples$data = {
readonly edges: ReadonlyArray<{
readonly node: {
readonly additionalEmailAddresses: ReadonlyArray<string>;
readonly createdAt: any;
readonly createdAt: string;
readonly fullName: string;
readonly id: string;
readonly kind: PeopleKind;
readonly primaryEmailAddress: string;
readonly updatedAt: any;
readonly updatedAt: string;
};
}>;
readonly pageInfo: {
readonly endCursor: any | null | undefined;
readonly endCursor: string | null | undefined;
readonly hasNextPage: boolean;
readonly hasPreviousPage: boolean;
readonly startCursor: any | null | undefined;
readonly startCursor: string | null | undefined;
};
};
readonly " $fragmentType": "PeopleListPage_peoples";

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<528ad6b0a104964c9d947ef1e9c41b46>>
* @generated SignedSource<<12b9bffcb7d1b32602592f77810dd9cb>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,12 +16,12 @@ export type PeopleOverviewPageQuery$variables = {
export type PeopleOverviewPageQuery$data = {
readonly node: {
readonly additionalEmailAddresses?: ReadonlyArray<string>;
readonly createdAt?: any;
readonly createdAt?: string;
readonly fullName?: string;
readonly id?: string;
readonly kind?: PeopleKind;
readonly primaryEmailAddress?: string;
readonly updatedAt?: any;
readonly updatedAt?: string;
readonly version?: number;
};
};

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<aa7d9efd2aaaa6af57bfc956754c69dd>>
* @generated SignedSource<<6ab9b7473f7ac19f7ed988d416de4ccd>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -29,7 +29,7 @@ export type PeopleOverviewPageUpdatePeopleMutation$data = {
readonly id: string;
readonly kind: PeopleKind;
readonly primaryEmailAddress: string;
readonly updatedAt: any;
readonly updatedAt: string;
readonly version: number;
};
};

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<03e542b8e2ecf3c17be86da4526541d2>>
* @generated SignedSource<<03490b3e2c1e510c108108be2aabdb60>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -18,8 +18,8 @@ export type CreateVendorInput = {
privacyPolicyUrl?: string | null | undefined;
riskTier: RiskTier;
serviceCriticality: ServiceCriticality;
serviceStartAt: any;
serviceTerminationAt?: any | null | undefined;
serviceStartAt: string;
serviceTerminationAt?: string | null | undefined;
statusPageUrl?: string | null | undefined;
termsOfServiceUrl?: string | null | undefined;
};
@@ -31,10 +31,10 @@ export type VendorListPageCreateVendorMutation$data = {
readonly createVendor: {
readonly vendorEdge: {
readonly node: {
readonly createdAt: any;
readonly createdAt: string;
readonly id: string;
readonly name: string;
readonly updatedAt: any;
readonly updatedAt: string;
};
};
};

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<4088732e27ad0219fc1d7a47b156bc6e>>
* @generated SignedSource<<36b79f3dc10a438f4bebae5387130337>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,8 +11,8 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type VendorListPagePaginationQuery$variables = {
after?: any | null | undefined;
before?: any | null | undefined;
after?: string | null | undefined;
before?: string | null | undefined;
first?: number | null | undefined;
id: string;
last?: number | null | undefined;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<116a0717d13f9b7f35da0cfb4f01de44>>
* @generated SignedSource<<0325c8c8e750f1d254a8dffb9e26870e>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,8 +11,8 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type VendorListPageQuery$variables = {
after?: any | null | undefined;
before?: any | null | undefined;
after?: string | null | undefined;
before?: string | null | undefined;
first?: number | null | undefined;
last?: number | null | undefined;
organizationId: string;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<193d632d808f2238377dab9c47d89f49>>
* @generated SignedSource<<a49f471e0d974928edd4bbc25dc8c762>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,18 +16,18 @@ export type VendorListPage_vendors$data = {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly createdAt: any;
readonly createdAt: string;
readonly description: string;
readonly id: string;
readonly name: string;
readonly updatedAt: any;
readonly updatedAt: string;
};
}>;
readonly pageInfo: {
readonly endCursor: any | null | undefined;
readonly endCursor: string | null | undefined;
readonly hasNextPage: boolean;
readonly hasPreviousPage: boolean;
readonly startCursor: any | null | undefined;
readonly startCursor: string | null | undefined;
};
};
readonly " $fragmentType": "VendorListPage_vendors";

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<2d865a3f5deae54eed7c54b08df7bf0a>>
* @generated SignedSource<<e6f91ab15045c3a5139af514ed4fe3c1>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,18 +16,18 @@ export type VendorOverviewPageQuery$variables = {
};
export type VendorOverviewPageQuery$data = {
readonly node: {
readonly createdAt?: any;
readonly createdAt?: string;
readonly description?: string;
readonly id?: string;
readonly name?: string;
readonly privacyPolicyUrl?: string | null | undefined;
readonly riskTier?: RiskTier;
readonly serviceCriticality?: ServiceCriticality;
readonly serviceStartAt?: any;
readonly serviceTerminationAt?: any | null | undefined;
readonly serviceStartAt?: string;
readonly serviceTerminationAt?: string | null | undefined;
readonly statusPageUrl?: string | null | undefined;
readonly termsOfServiceUrl?: string | null | undefined;
readonly updatedAt?: any;
readonly updatedAt?: string;
readonly version?: number;
};
};

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<6453606aec7f5a8548c5cc76e9d775f0>>
* @generated SignedSource<<918d7356c117ff6830c2c41b7db72ddd>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -19,8 +19,8 @@ export type UpdateVendorInput = {
privacyPolicyUrl?: string | null | undefined;
riskTier?: RiskTier | null | undefined;
serviceCriticality?: ServiceCriticality | null | undefined;
serviceStartAt?: any | null | undefined;
serviceTerminationAt?: any | null | undefined;
serviceStartAt?: string | null | undefined;
serviceTerminationAt?: string | null | undefined;
statusPageUrl?: string | null | undefined;
termsOfServiceUrl?: string | null | undefined;
};
@@ -36,11 +36,11 @@ export type VendorOverviewPageUpdateVendorMutation$data = {
readonly privacyPolicyUrl: string | null | undefined;
readonly riskTier: RiskTier;
readonly serviceCriticality: ServiceCriticality;
readonly serviceStartAt: any;
readonly serviceTerminationAt: any | null | undefined;
readonly serviceStartAt: string;
readonly serviceTerminationAt: string | null | undefined;
readonly statusPageUrl: string | null | undefined;
readonly termsOfServiceUrl: string | null | undefined;
readonly updatedAt: any;
readonly updatedAt: string;
readonly version: number;
};
};