After developing a serverless GraphQL API function using Azure functions and connecting it to Cosmos DB, I have encountered an issue with "Invalid URL" that has been puzzling me for a week. Despite running the graphql function locally without any problems, I am struggling to resolve this error. Any assistance or suggestions would be greatly appreciated.
Below is my index.ts file:
[Code snippet]
Apollo Datasource
[Code snippet]
When testing the GraphQL API from Postman, the output shows a Status 200 but returns the following graphql error message:
{
"errors": [
{
"message": "Invalid URL",
"locations": [...],
"path": [...],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"input": "undefined",
"code": "ERR_INVALID_URL",
"stacktrace": [...]
}
}
}
],
"data": null
}
Furthermore, the function URL was obtained from the following source: https://i.sstatic.net/mVQrd.png