GraphQL Advanced Projection (v2.0.0) is a fully customizable Mongoose/MongoDB projection generator for GraphQL resolvers. It decouples GraphQL schema definitions from MongoDB projection configurations, allowing independent changes. Supports interfaces, fragments, and inline fragments. Provides automatic resolver generation for simple field mappings. Released under MIT license. Active maintenance with occasional updates. Differentiates from alternatives by offering separate schema/projection config, easy customization via simple field mapping, and automatic resolver creation.
npm install graphql-advanced-projectionNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Setup and usage of graphql-advanced-projection with Mongoose and GraphQL-Tools.
Set field to null explicitly to exclude it, or use empty object {} to include all fields.Always pass info to project(info) inside resolver.
Migrate to v2: use { proj: { field: 'mongoField' } } instead of { projection: { field: 'mongoField' } }.Avoid defining resolvers for fields already mapped in proj, or override them after merging resolvers.
Use import syntax.
Ensure you pass the info argument from the resolver: project(info).
Use { User: { proj: { ... } } } as config.Either add 'field2' to proj or define a resolver for it.
Remove manual resolver for auto-mapped fields or use override.
No dependency data recorded yet.