Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/platform/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VITE_API_URL=https://dev.opentargets.xyz/api/v4/graphql
VITE_API_URL=https://ng.opentargets.org:8080/latest/graphql
VITE_AI_API_URL=https://dev-ai-api-w37vlfsidq-ew.a.run.app
VITE_PROFILE=platform
VITE_PATHWAYS_API_URL=
PLAYWRIGHT_TEST_BASE_URL=http://localhost:3000
PLAYWRIGHT_TEST_BASE_URL=http://localhost:3000
17 changes: 16 additions & 1 deletion packages/ot-constants/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,29 @@ if (!VITE_API_URL) {
throw new Error("VITE_API_URL environment variable is not set in .env file");
}

// Documents already migrated to the current API: each gets an exact result type
// (`<OperationName>` / `<OperationName>Variables`) in src/types/index.ts. Add a
// page's documents here once its queries validate against the API.
const MIGRATED_DOCUMENTS = [
"apps/platform/src/pages/DiseasePage/**/*.gql",
"apps/platform/src/pages/TargetPage/TargetAssociations/*.gql",
"apps/platform/src/components/AssociationsToolkit/components/Table/RowInteractors/InteractorsQuery.gql",
"apps/platform/src/components/GeneEnrichmentAnalysis/api/*.gql",
"packages/sections/src/disease/{Bibliography,Drugs,GWASStudies,Ontology,Phenotypes}/*.gql",
"packages/sections/src/drug/Bibliography/*.gql",
"packages/sections/src/target/Bibliography/*.gql",
"packages/ui/src/components/ClinicalReports/*.gql",
].map((glob) => resolve(__dirname, "../..", glob));

const config: CodegenConfig = {
overwrite: true,
schema: `${VITE_API_URL}`,
documents: MIGRATED_DOCUMENTS,
errorsOnly: false,
generates: {
"./src/types/index.ts": {
plugins: ["typescript", "typescript-operations", "typescript-graphql-request"],
config: { gqlTagName: "gql", rawRequest: false },
config: { gqlTagName: "gql", rawRequest: false, omitOperationSuffix: true },
},
},
};
Expand Down
Loading
Loading