A library that integrates lodash-style data manipulation directly into GraphQL queries using the @_ directive, allowing query-time transformations like filtering, sorting, and mapping. Current stable version is 1.3.4, with irregular releases. It is experimental and designed for client-side usage; server-side use is discouraged. Key differentiator: collocates data fetching and transformation in one query, reducing post-processing code.
npm install graphql-lodashNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic graphql-lodash usage: creating a query with @_ directives, stripping directives via graphqlLodash, then applying transform to the response data.
Evaluate alternatives or contribute to the project; use at your own risk.
Check the node_modules/graphql-lodash source or docs for supported methods; default set includes core methods like get, filter, map, reduce, sortBy, groupBy, etc.
Use import { graphqlLodash } from 'graphql-lodash' instead of import graphqlLodash from 'graphql-lodash'.Call transform(result.data) or transform(result) if result is the data object.
Use import { graphqlLodash } from 'graphql-lodash'Ensure you pass the data property: transform(result.data)
Use graphqlLodash to get the cleaned query string and send that to the server.