json-logic-js-graphql extends json-logic-js with GraphQL-compatible Lodash methods, enabling the use of logical operators like `_eq`, `_gt`, `_gte`, `_lt`, `_lte`, `_and`, `_or`, and date functions via moment.js. Current stable version is 1.2.4, released in 2021 with low release cadence. It solves the problem that GraphQL does not support keys like `==` or `===` by providing underscore-prefixed alternatives. Differs from plain json-logic-js by adding Lodash utility functions exposed as operators, and includes moment.js date comparisons. Suitable for applications that need to store or pass JSON Logic rules in GraphQL mutations.
npm install json-logic-js-graphqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows usage of json-logic-js-graphql with _and, _eq, _gt operators, and logging the result.
Replace operators like `==` with `_eq`, `>` with `_gt`, etc.
Consider using an alternative date library or implementing custom date operators.
Use `import { jsonLogic } from 'json-logic-js-graphql'` instead of default import.Check the operators.js file in the package or the GitHub repository for the complete list.
Ensure the second argument is an array like [number, 'unit'], e.g., [364, 'days'].
Run `npm install json-logic-js` or `yarn add json-logic-js`.
Use `import { jsonLogic } from 'json-logic-js-graphql'` and ensure jsonLogic is defined.