oasis-open / odata-rapid

Rapid - Specification, tools and libraries to support the development and adoption of simple REST-based APIs.
https://rapid.rocks
Apache License 2.0
17 stars 8 forks source link

GraphQL client tutorial fails in step "Preview your service with GraphQL" #389

Closed ralfhandl closed 1 year ago

ralfhandl commented 1 year ago

Following the instructions in GraphQL client tutorial fails in step Preview your service with GraphQL:

yarn mesh dev

or equivalently

npx mesh dev

fail with error message

💡 🕸️  Mesh - Server  Generating the unified schema...
💥 🕸️  Mesh - Jetsons  Failed to generate the schema TypeError: Cannot read properties of undefined (reading '0')
    at ODataHandler.getMeshSource (C:\temp\rapid-graphql-client-tutorial\node_modules\@graphql-mesh\odata\index.js:121:42)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C:\temp\rapid-graphql-client-tutorial\node_modules\@graphql-mesh\runtime\index.js:281:28
💥 🕸️  Mesh  An error occured while writing the schema file: Error: Schemas couldn't be generated successfully. C...
💥 🕸️  Mesh  An error occurred while building the artifacts: Error: Schemas couldn't be generated successfully. C...
💥 🕸️  Mesh - Server  Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 e...

Replacing the baseUrl with https://services.odata.org/V4/(S(oygeljzs0rz0wq0k2vd4j3zk))/TripPinServiceRW/, so this seems to be a communication problem between GraphQL Mesh and the Jetsons service.

mikepizzo commented 1 year ago

Appears to be due to the fact that Mesh is not sending application/xml in the accept header for metadata, so if the service defaults to application/json they are not able to handle the response since they only support xml.