Expand my Community achievements bar.

Mesh use cases are Api gateway only-no resolver support?

Avatar

Community Advisor and Adobe Champion

Hi team,

 

Last year when i worked on Adobe Mesh then it provided support to use additionalresolver and perform operation in the same mesh. Now i can see it act as Api gateway just to provide single endpoint for multiple platforms like magento, rest apis, third party api etc.

SO we can't use additionalresolvers, operation now in api mesh rather calling apis via gateway for safety purposes ?

 

Please share thoughts as we are planning to use mesh to perform operations.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Employee

Hello Heena,

Thank you for your insightful question about the potential use cases of API Mesh.

API Mesh is an extensible reverse GraphQL proxy. To break this down:

  • Reverse Proxy: It provides a single public endpoint that routes requests to multiple backend services.

  • GraphQL Proxy: The public endpoint, generated after deploying the mesh, is a GraphQL endpoint.

  • Extensible: You can enhance it by adding custom resolvers or hooks to modify how GraphQL operations are executed.

To answer your question, API Mesh functions as a gateway while also offering the flexibility to extend your sources with custom resolvers, enabling more advanced use cases.

We maintain a samples repository with various use cases and their corresponding mesh configurations. You can explore it here: Adobe Commerce Samples - API Mesh. We regularly update this repository with new use cases, and we'd love to have you contribute any additional ones you may have.

For a deeper understanding of the use cases and the inner workings of the mesh, I recommend checking out this video: Deep Dive into API Mesh.

Additionally, you can refer to the official documentation for comprehensive details: API Mesh Service Documentation.

I hope this clarifies things. Let me know if you have any further questions.

Avatar

Community Advisor and Adobe Champion

yes @ananvara 

we are on same page now. I have created project using aio app init and it has created project where web-src is generated and once you deployed it has html and web endpoints.

For my case, i need mesh.json file where i need to perform some magento operation say add to cart which will call to magento and return true /false accordingly.

So fir this i have created project using npm init -y and added mesh.json file with resolver file like:

HeenaMadan_0-1744880221087.png

mesh.json:

{
"meshConfig": {
"sources": [
{
"name": "MagentoGraphQL",
"handler": {
"graphql": {
"endpoint": "https://domain.com/graphql",
"operationHeaders": {
"Content-Type": "application/json",
"store": "mystore"
}
}
}
}
],
"additionalResolvers": ["./mesh/customResolver.js"]
}
}

 

not able to deploy locally and on app builder project. Can you help me here?

Avatar

Level 7

Hi @HeenaMadan ,

 

Use aio app init to scaffold the project.

Choose API Mesh extension during setup.

 

Ensure you place your mesh.json and customResolver.js correctly:

Your project should look like:

 

/src
   /api-mesh
       mesh.json
       customResolver.js
.env
.aio
package.json

 

Define the resolver in mesh.json like you already did:

{
"meshConfig": {
"sources": [
{
"name": "MagentoGraphQL",
"handler": {
"graphql": {
"endpoint": "https://domain.com/graphql",
"operationHeaders": {
"Content-Type": "application/json",
"store": "mystore"
}
}
}
}
],
"additionalResolvers": ["./customResolver.js"]
}
}

 

Install required dependencies:

npm install @graphql-mesh/cli @graphql-mesh/runtime @graphql-mesh/graphql

 

Add build command in your package.json (if needed):

"scripts": {
"mesh:dev": "graphql-mesh serve",
"mesh:build": "graphql-mesh build"
}

 

Run it locally to test (if needed):

npm run mesh:dev

 

Deployment with App Builder:
If you’re still getting issues on deployment:

  • Make sure your .aio configuration includes your API Mesh extension.
  • Use the aio app deploy command from the project root.
  • Log into Adobe I/O with aio login if you haven’t.
  • Check Adobe I/O Console for mesh-specific logs and failures.