Hello everyone, Over the past few months, while building standalone PWA applications on top of Apache OFBiz I've been thinking about our API strategy and wanted to share an observation from my implementation experience.
I believe our current direction of exposing REST APIs backed by OFBiz services is the right foundation. The business logic remains encapsulated within OFBiz services, while REST APIs expose well-defined business operations for external applications. However, as I build more UI screens, I've noticed that many pages require data from multiple business domains. For example, an order screen may need information about a customer, a product, and inventory. There are generally two approaches today: - Make multiple REST API calls and compose the data on the client. - Create a dedicated REST endpoint that aggregates everything required for that particular screen. Both approaches work well, but as we build more PWAs and different clients, we may gradually end up with many UI-specific aggregation APIs. Different applications like PWAs, mobile applications, dashboards, and AI agents often require different combinations of the same business objects. This made me wonder whether exploring GraphQL support in OFBiz would be worthwhile. The GraphQL server would simply orchestrate existing OFBiz services, while all business logic would continue to reside in the service layer. The main benefit would be that clients could request exactly the data they need in a single query. This would reduce multiple network calls, avoid over-fetching unnecessary data, and provide a strongly typed, discoverable API for developers building applications on top of OFBiz. As OFBiz continues moving toward API-first development and standalone applications, I think this could be an interesting capability to explore. I'd be interested in hearing the community's thoughts on a few questions: - Would it make sense to prototype GraphQL support as an optional plugin first, allowing the community to evaluate its usefulness? - If the idea proves valuable, should GraphQL support eventually belong in the framework itself, or should it remain an optional plugin? - Has anyone previously experimented with GraphQL integration in OFBiz or evaluated similar approaches? - Are there architectural considerations or challenges that should be taken into account before exploring this direction? I'd love to hear different perspectives from the community. Thanks -- Divesh Dutta www.hotwaxsystems.com
