I want to connect a REST API https://swapi.dev/api/ to API Mesh. My mesh.json looks like this:
{
"meshConfig": {
"sources": [
{
"name": "RESTSWAPI",
"handler": {
"openapi": {
"source": "https://swapi.dev/api/"
}
}
}
]
}
}
But I get this error message:
Your mesh errored out with the following error. Building Mesh with config: /usr/src/node-app/8ab88e57-f4dd-42a2-b6b1-c82e5b219704
️ Mesh Cleaning existing artifacts
️ Mesh Reading the configuration
️ Mesh Generating the unified schema
️ Mesh - RESTSWAPI Dereferencing the bundle
️ Mesh - RESTSWAPI Creating the GraphQL Schema from dereferenced schema
️ Mesh - RESTSWAPI Failed to generate the schema Error: The visitor result should be a SchemaComposer instance.
at getGraphQLSchemaFromDereferencedJSONSchema (/usr/src/node-app/node_modules/@omnigraph/json-schema/index.js:2317:15)
at async OpenAPIHandler.getMeshSource (/usr/src/node-app/node_modules/@graphql-mesh/openapi/index.js:49:24)
at async /usr/src/node-app/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:133:28
at async Promise.allSettled (index 0)
at async getMesh (/usr/src/node-app/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:128:5)
at async Object.handler (/usr/src/node-app/node_modules/@graphql-mesh/cli/cjs/index.js:311:53)
️ Mesh Error: Schemas couldn't be generated successfully. Check for the logs by running Mesh with DEBUG=1 environmental variable to get more verbose output.
at getMesh (/usr/src/node-app/node_modules/@graphql-mesh/runtime/cjs/get-mesh.js:167:15)
at async Object.handler (/usr/src/node-app/node_modules/@graphql-mesh/cli/cjs/index.js:311:53)
Is Star Wars API not a Open API / Swagger API?
Thank you for your help