I've identified a few bugs in our TypeScript API implementation that need to be addressed. Below are the issues and my proposed solutions for each:
Bug 1: Axios baseURL Not Set
Issue: The axios instance is not configured with a baseURL, which causes issues when a custom prefix is set and needs to take effect.
Proposed Solution: In client.ts, set the baseURL for the axios configuration as follows:
AgdbApi.api = new OpenAPIClientAxios({
definition: `${address}/api/v1/openapi.json`,
axiosConfigDefaults: {
baseURL: `${address}`, // Set axios's baseURL
},
});
Bug 2: InsertNodesBuilder Not Passing IDs
Issue: The InsertNodesBuilder is not passing ids, which results in them not being effective.
Proposed Solution: In query_builder.ts, modify the ids method to ensure ids are passed correctly:
I've identified a few bugs in our TypeScript API implementation that need to be addressed. Below are the issues and my proposed solutions for each:
Bug 1: Axios baseURL Not Set
Issue: The axios instance is not configured with a baseURL, which causes issues when a custom prefix is set and needs to take effect. Proposed Solution: In client.ts, set the baseURL for the axios configuration as follows:
Bug 2: InsertNodesBuilder Not Passing IDs
Issue: The InsertNodesBuilder is not passing ids, which results in them not being effective.
Proposed Solution: In query_builder.ts, modify the ids method to ensure ids are passed correctly:
And update the InsertNodesIdsBuilder class constructor to handle undefined data properly:
Bug 3: InsertEdgesBuilder Has Similar Issue as Bug 2
Issue: The InsertEdgesBuilder faces the same problem as InsertNodesBuilder where ids are not being passed effectively.
Proposed Solution: In query_builder.ts, adjust the ids method for InsertEdgesBuilder similar to the solution for InsertNodesBuilder:
Ensure the InsertEdgesIdsBuilder class is correctly handling the query data:
I believe these solutions will resolve the current bugs and improve the stability and functionality of our API.
Thank you for your review and consideration.
Best regards, pinghe