Wolkenkit能否仅作服务器或适配GraphQL?相关技术问询
Hey there! Let's tackle your wolkenkit questions clearly:
Wolkenkit works perfectly as a standalone server right out of the box—its core is built to handle event-driven workflows, command processing, and read model management entirely on its own, no extra tools required.
As for GraphQL integration, that's totally doable too. By default, wolkenkit exposes read models via REST APIs, so you can easily layer a GraphQL server on top of these endpoints as a gateway. Your GraphQL resolvers would fetch data from wolkenkit's read model endpoints and map it to your GraphQL schema. If you want a more direct approach, you can also extend wolkenkit's functionality to add custom GraphQL support, though the gateway method is usually simpler and more maintainable for most use cases.
Absolutely—you can use wolkenkit purely over HTTP, ditching its client library entirely. Here's a step-by-step breakdown of what you need to do:
- Ensure wolkenkit's HTTP API is enabled: By default, wolkenkit exposes a REST API for both commands and read models. Just confirm your server is configured to listen on the correct HTTP port (this is set in your project's
package.jsonor wolkenkit config file). - Send commands via HTTP POST: To trigger actions in wolkenkit, send
POSTrequests to endpoints following the patternhttp://<your-server>:<port>/commands/<context>/<aggregate>/<command>. The request body needs the aggregate ID, payload, and any required metadata. Example request:POST /commands/tasks/task/create Content-Type: application/json { "aggregateId": "task-123", "payload": { "title": "Wrap up wolkenkit HTTP setup" } } - Fetch read models via HTTP GET: Wolkenkit serves read models at
http://<your-server>:<port>/read-models/<context>/<read-model>. You can filter, sort, and paginate using query parameters. For example, to get all completed tasks sorted by creation date:GET /read-models/tasks/completedTasks?filter=status:completed&sort=createdAt:desc - Build your GraphQL layer: Set up a GraphQL server that acts as a middleman. Your GraphQL resolvers will make HTTP GET requests to wolkenkit's read model endpoints to fetch data, then map that data to your GraphQL schema. For mutations (actions), your GraphQL mutation resolvers will translate to HTTP POST requests to wolkenkit's command endpoints.
- Skip the client library entirely: Since all interactions use standard HTTP methods, you don't need to install or use the wolkenkit client SDK at all. This gives you full control over your client-side code or GraphQL layer, without being tied to the library's opinions.
内容的提问来源于stack exchange,提问作者ssomnoremac

