-
Hi everyone, I'm currently using react-awesome-query-builder for a project and am very pleased with its functionality. However, I have a specific requirement for formatting the query output in JSON, similar to how react-querybuilder does it. Here's the JSON format I am looking to achieve:
The primary reason for this format is that we want to compare different versions of the rules and highlight specific changes between them. Is there currently a way to achieve this output format with react-awesome-query-builder? If not, are there any plans to support this, or could you provide guidance on how we might extend the library to accommodate this format? Thank you for your assistance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think all you need is to rename keys like condition -> combinator. |
Beta Was this translation helpful? Give feedback.
Utils.Export.queryBuilderFormat
provides export in very similar format.https://github.com/ukrbublik/react-awesome-query-builder/blob/master/packages/core/modules/export/queryBuilder.js
react-awesome-query-builder/packages/core/modules/index.d.ts
Line 516 in 0daf399
I think all you need is to rename keys like condition -> combinator.
You can make a PR to add these renamings. (Ideally with configuration of key names in
config.settings
to prevent breaking changes. Or just copy file and create separate export function with required keys)