{"_id":"@anthor/graphql-compose-mongoose","_rev":"12-663267eb4132b5defd4f7da7ac778e7e","name":"@anthor/graphql-compose-mongoose","dist-tags":{"latest":"0.0.4-rc"},"versions":{"0.0.1":{"name":"@anthor/graphql-compose-mongoose","version":"0.0.1","keywords":["graphql","compose","graphql-compose","mongoose","mongodb"],"license":"MIT","_id":"@anthor/graphql-compose-mongoose@0.0.1","maintainers":[{"name":"solrac0","email":"carlosh.guimaraes@hotmail.com"},{"name":"vytorcalixto","email":"vytorcalixto@gmail.com"},{"name":"zeowna","email":"joselucaschociai@gmail.com"},{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},{"name":"wmenegali","email":"wmenegali@gmail.com"}],"contributors":[{"name":"Pavel Chertorogov","email":"pavel.chertorogov@gmail.com"}],"homepage":"https://github.com/graphql-compose/graphql-compose-mongoose","bugs":{"url":"https://github.com/graphql-compose/graphql-compose-mongoose/issues"},"dist":{"shasum":"39424a74ef05eac45bc4bb3542fe6a7f9da7c988","tarball":"https://registry.npmjs.org/@anthor/graphql-compose-mongoose/-/graphql-compose-mongoose-0.0.1.tgz","fileCount":577,"integrity":"sha512-vdaPDuReiV1vlZkeaLLxEChck+juUNTaHpqe/jh+zEyRXu0CIWsOJ4URK33yEW5A8+eI6NkO8fwgzTa0lIzb2A==","signatures":[{"sig":"MEUCIQChjmZ+POzxTCJl9YdzWBVhsCiEcp0334eoqvYHdw6eSQIgKX5FoRYTLjlWg2LU3WXqlmEUML9JherGMJsaR5NlzZ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1899126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAUg9CRA9TVsSAnZWagAAtWQP/3pVdDKsV8JideaCzKc1\nuLfJ+n99Q28/dtt+FgKfSMt2K46wHq/n23O3so6KT3VNejfAhWTwaIorxWKL\nY6923XRcjmSjfbuf5vDGllXrX4sHCgVknpzc9hhaKns6nvkEELoIDXeBj/Sx\nnUYtGYqKy2RooNET7unLAzdcSxW7DAKit1VWiMSwX11ffSgZHlaa/dyUxB5m\nhPIdItMplvGbElB2hhXoQYjzU2NCNaevvp0MmYeGgKo31IafoPVk4/naHpN4\nkYpJiq4Q4ihRj7ta8UAaVGjqnzKP4BVFqbw6RnRoN+t2RAGWHC+KcRFkv40Z\nKa+ldye/eqLx1PlN2ZNDfDzWcozhZUOYAsVRmIL40XPxFWJD4+1DPcpiX3ot\nJfnGCiGohc+oDeZI/ZMsR79qF4cCM749LZ/tP089gO24Upb7SfAmqRlVl9dT\nnXCo0O6NR9UmK324FzJXIz5V5LpcJ903fSM27WqckO5W8F7+d7BYVlDj2UkI\nZzHDK5Qs08nQLDq4W2lVgm4434JbkbIt35AIms+/tcsK9ETiXlIsIOMmSJiW\nSu+M664/lqmGz21bvAJBzi8vC7Tl09zzpMbP6Wzew6PV6RSvW+rV6rnfU3u4\no2xxRnt9HjeaVgJfCYEOneeYPDvAAHjMyn1hOppCwQDU7HVpeEuO/MO8sGed\nvhfm\r\n=j9yz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","types":"lib/index.d.ts","module":"mjs/index.mjs","gitHead":"fa5d764b31d5e6d51a9b29d105b7aed45782551e","scripts":{"flow":"flow","link":"yarn build && yarn link graphql-compose && yarn link graphql-compose-connection && yarn link graphql-compose-pagination && yarn link mongoose && yarn link","lint":"npm run eslint && npm run tslint","test":"npm run coverage && npm run lint && npm run flow && npm run tscheck","build":"npm run build-lib && npm run build-mjs && npm run build-es && npm run build-node8 && npm run build-ts","watch":"jest --watch","eslint":"eslint --ext .js ./src","tslint":"tslint -p .","unlink":"rimraf node_modules && yarn install","tscheck":"tsc --noEmit","build-es":"rimraf es && BABEL_ENV=es babel src --ignore __tests__,__mocks__ -d es && COPY_TO_FOLDER=es npm run build-flow","build-ts":"find ./src -name '*.d.ts' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`; done","coverage":"jest --coverage --maxWorkers 4","build-lib":"rimraf lib && BABEL_ENV=cjs babel src --ignore __tests__,__mocks__ -d lib && COPY_TO_FOLDER=lib npm run build-flow","build-mjs":"rimraf mjs && BABEL_ENV=mjs babel src --ignore __tests__,__mocks__ -d mjs && yarn build-mjs-rename && COPY_TO_FOLDER=mjs npm run build-flow","build-flow":"echo `$1` && find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`.flow; done","build-node8":"rimraf node8 && BABEL_ENV=node8 babel src --ignore __tests__,__mocks__ -d node8 && COPY_TO_FOLDER=node8 npm run build-flow","build-mjs-rename":"find ./mjs -name \"*.js\" -exec sh -c 'mv \"$1\" \"${1%.js}\".mjs' - '{}' \\;","semantic-release":"semantic-release"},"_npmUser":{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},"repository":{"url":"git+https://github.com/graphql-compose/graphql-compose-mongoose.git","type":"git"},"_npmVersion":"6.5.0","description":"Plugin for `graphql-compose` which derive a graphql types from a mongoose model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"object-path":"^0.11.4","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.8.0","eslint":"^5.16.0","rimraf":"^2.6.3","tslint":"^5.17.0","graphql":"14.3.1","request":"^2.88.0","flow-bin":"^0.100.0","mongoose":"^5.5.12","prettier":"^1.17.1","@babel/cli":"^7.4.4","babel-core":"^7.0.0-bridge.0","babel-jest":"^24.8.0","typescript":"^3.5.1","@babel/core":"^7.4.5","babel-eslint":"^10.0.1","@types/graphql":"^14.2.0","@types/mongoose":"5.5.5","graphql-compose":"^7.1.0","semantic-release":"^15.13.12","@babel/preset-env":"^7.4.5","@babel/preset-flow":"^7.0.0","eslint-plugin-import":"^2.17.3","mongodb-memory-server":"^5.1.2","eslint-config-prettier":"^4.3.0","eslint-plugin-flowtype":"^3.9.1","eslint-plugin-prettier":"^3.1.0","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","eslint-config-airbnb-base":"^13.1.0","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-transform-flow-strip-types":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"peerDependencies":{"mongoose":"^5.0.0 || ^4.4.0","graphql-compose":"^7.1.0"},"optionalDependencies":{"graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/graphql-compose-mongoose_0.0.1_1560365116387_0.3521192177011787","host":"s3://npm-registry-packages"}},"0.0.2-rc.1":{"name":"@anthor/graphql-compose-mongoose","version":"0.0.2-rc.1","keywords":["graphql","compose","graphql-compose","mongoose","mongodb"],"license":"MIT","_id":"@anthor/graphql-compose-mongoose@0.0.2-rc.1","maintainers":[{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},{"name":"solrac0","email":"carlosh.guimaraes@hotmail.com"},{"name":"vytorcalixto","email":"vytorcalixto@gmail.com"},{"name":"wmenegali","email":"wmenegali@gmail.com"},{"name":"zeowna","email":"joselucaschociai@gmail.com"}],"contributors":[{"name":"Pavel Chertorogov","email":"pavel.chertorogov@gmail.com"}],"homepage":"https://github.com/graphql-compose/graphql-compose-mongoose","bugs":{"url":"https://github.com/graphql-compose/graphql-compose-mongoose/issues"},"dist":{"shasum":"72690984332f12551d85da2f31e8adeee2144560","tarball":"https://registry.npmjs.org/@anthor/graphql-compose-mongoose/-/graphql-compose-mongoose-0.0.2-rc.1.tgz","fileCount":577,"integrity":"sha512-4hsKWvC0VYPJNUfXQBCP1U9ij/odbioMRdY/1JJbk8AGajnoHnAAkr7Ys7S+Kk1oHjBKFoVnzMxr2jxptAul8Q==","signatures":[{"sig":"MEUCIAIMlxpRaCIUulZYYO5qMpGJRtB7X6mA1uyHDMqhOBAfAiEAlelOKfrB5Lt5RfoMqr3euuZ25ZhdxLGUhTj1cn4870U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1899255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAUuPCRA9TVsSAnZWagAA1LUP/Asev4aTuFCOP9pfWmbe\n3aJHTdbEiwbhRdMYGtrC15eNDM66jKE5OlyCDiXUDTP+mI+yNeWXTuK8FHak\njKIWYM7CxAo51WpsNWmGKQOZGm/8juwOvzMfigSChPc5tJ/L4BBouh7l1+qZ\nN4w8utu+u192ojeq8vJk/ti+5fVv7LcSkZ9mLjpLTNrkdMVZLiw9kxinAiz5\nh/QigsLnSrcvDQtdTMC1hlB3GJURuZodNd3x/NnD2wJrhB+9mrIKF2cBLLOc\nUkH5ntbc6M7ZqrPG0FV33zgcF7P1OZipDddgmEe6dlvTtx8insuJ4vPUT+0h\n3UUBlwS1WBOLeK6tWbe6Gm0WC9hp5ydcF2S5c/AO9cpDQaw/XdhLBYv2A3Rk\nBeWXSvCFNZYykuZcwD3Ybs2yV0BonnnvZum/gFI2FaGxFYfQNcJfhItr30dB\nt94KFQ4xXodsAqyPv4Ko6xTmRW8DDIIEWMCXSjFiXsKUTBZ7TyUuViNc1WPJ\nzG3eHBfqWggZVKQaYKo0GCgxpQyrKHJylZDS2UoggYpg5xNZb4kSE6we0NrS\n75nNLI3+B9sQ9VtcZEYtBTzea/8IEHSuI8h5gOBTlpAPNsyJgI9RkBMnbzAC\n7lemYMvtmISVN8Acuxy4KQ66PRPZDYeBSum2piwcFcCpvsuGg7vR0Sa2B1TH\nWsl0\r\n=PVub\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","types":"lib/index.d.ts","module":"mjs/index.mjs","gitHead":"fa5d764b31d5e6d51a9b29d105b7aed45782551e","scripts":{"flow":"flow","link":"yarn build && yarn link graphql-compose && yarn link graphql-compose-connection && yarn link graphql-compose-pagination && yarn link mongoose && yarn link","lint":"npm run eslint && npm run tslint","test":"npm run coverage && npm run lint && npm run flow && npm run tscheck","build":"npm run build-lib && npm run build-mjs && npm run build-es && npm run build-node8 && npm run build-ts","watch":"jest --watch","eslint":"eslint --ext .js ./src","tslint":"tslint -p .","unlink":"rimraf node_modules && yarn install","tscheck":"tsc --noEmit","build-es":"rimraf es && BABEL_ENV=es babel src --ignore __tests__,__mocks__ -d es && COPY_TO_FOLDER=es npm run build-flow","build-ts":"find ./src -name '*.d.ts' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`; done","coverage":"jest --coverage --maxWorkers 4","build-lib":"rimraf lib && BABEL_ENV=cjs babel src --ignore __tests__,__mocks__ -d lib && COPY_TO_FOLDER=lib npm run build-flow","build-mjs":"rimraf mjs && BABEL_ENV=mjs babel src --ignore __tests__,__mocks__ -d mjs && yarn build-mjs-rename && COPY_TO_FOLDER=mjs npm run build-flow","build-flow":"echo `$1` && find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`.flow; done","build-node8":"rimraf node8 && BABEL_ENV=node8 babel src --ignore __tests__,__mocks__ -d node8 && COPY_TO_FOLDER=node8 npm run build-flow","build-mjs-rename":"find ./mjs -name \"*.js\" -exec sh -c 'mv \"$1\" \"${1%.js}\".mjs' - '{}' \\;","semantic-release":"semantic-release"},"_npmUser":{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},"repository":{"url":"git+https://github.com/graphql-compose/graphql-compose-mongoose.git","type":"git"},"_npmVersion":"6.5.0","description":"Plugin for `graphql-compose` which derive a graphql types from a mongoose model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"object-path":"^0.11.4","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.8.0","eslint":"^5.16.0","rimraf":"^2.6.3","tslint":"^5.17.0","graphql":"14.3.1","request":"^2.88.0","flow-bin":"^0.100.0","mongoose":"^5.5.12","prettier":"^1.17.1","@babel/cli":"^7.4.4","babel-core":"^7.0.0-bridge.0","babel-jest":"^24.8.0","typescript":"^3.5.1","@babel/core":"^7.4.5","babel-eslint":"^10.0.1","@types/graphql":"^14.2.0","@types/mongoose":"5.5.5","graphql-compose":"^7.1.0","semantic-release":"^15.13.12","@babel/preset-env":"^7.4.5","@babel/preset-flow":"^7.0.0","eslint-plugin-import":"^2.17.3","mongodb-memory-server":"^5.1.2","eslint-config-prettier":"^4.3.0","eslint-plugin-flowtype":"^3.9.1","eslint-plugin-prettier":"^3.1.0","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","eslint-config-airbnb-base":"^13.1.0","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-transform-flow-strip-types":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"peerDependencies":{"mongoose":"^5.0.0 || ^4.4.0","graphql-compose":"^7.1.0"},"optionalDependencies":{"graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/graphql-compose-mongoose_0.0.2-rc.1_1560365966327_0.8033017509042741","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@anthor/graphql-compose-mongoose","version":"0.0.2","keywords":["graphql","compose","graphql-compose","mongoose","mongodb"],"license":"MIT","_id":"@anthor/graphql-compose-mongoose@0.0.2","maintainers":[{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},{"name":"solrac0","email":"carlosh.guimaraes@hotmail.com"},{"name":"vytorcalixto","email":"vytorcalixto@gmail.com"},{"name":"wmenegali","email":"wmenegali@gmail.com"},{"name":"zeowna","email":"joselucaschociai@gmail.com"}],"contributors":[{"name":"Pavel Chertorogov","email":"pavel.chertorogov@gmail.com"}],"homepage":"https://github.com/graphql-compose/graphql-compose-mongoose","bugs":{"url":"https://github.com/graphql-compose/graphql-compose-mongoose/issues"},"dist":{"shasum":"d0a1b5190829bba29a041046d9fb1baed7991a60","tarball":"https://registry.npmjs.org/@anthor/graphql-compose-mongoose/-/graphql-compose-mongoose-0.0.2.tgz","fileCount":577,"integrity":"sha512-o8aQT6pllBvO7dM4tbJB/eL2cNgqy7EsihHpSUSdkSIPsRG0W9Wi5GynzohSkuM2UJlOhZ5NqVny2D7VPVu+Rw==","signatures":[{"sig":"MEQCICJatCJ78bIycAjqWv5Z1msXGTJZU9Y++mA0hbW/3VE4AiBYhBIm9y8H5O8jsGWAcUphQNrBe2PGR9PPGUv/t0nmKw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1899126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAU8mCRA9TVsSAnZWagAA6IMQAIFVgEIrxPB2laNH15h5\nYTbzbthDJBm9Hqfd2Z+lsz8XOcv8PpKtETNyjvjUZh2QEUCFMKmlQjjkfPUm\n63p8J5Hwf8Tkk3A2k/WzOWov/MtWtJA+hD7Lm4XRu+ECfo9YPtqMqJoftjQT\nahWCrkhDAKYJMyCtd2O+myiBGNltNP3y/1kx2K7E/G2CG/p12a/0QpCfMrzQ\nmjPzovOFLplxQzF75HmZRIIStR6D+XHmz6p7V5GmWVbLSHtxEwp3WBE6HGiH\nbs2QRCVCbuOxvzARx1WPAVsyRcktu9A7Is8EIzNxm742I48h6ikomtGtbQ0g\nWrUHj1q68WdzUCyCeitnHLz1GP4nYhGSR4zYxmf0HT8Acu8I3veLbh36FhqS\ngVR7hxj5bgMqGL5wd8ESYadLciVZolgI6blZpdG2Lui3qqKo4r/dke4zFQ03\nFUhRrKSC8+1V1YSw6ynDryzuBzTLaXuxhzQSWsXf3iGiBc5E6/Q8AsXCoN/a\ngpI2ONK73r6DQCFf/24jT9pHcmgvGAkiKPSCRltuxVdILcjdq9c1jiSrf9wj\nGWn3vugdKQAD7l5KcD3Toe0SObb/VESyZJHq/3GdepIpFgo/t0x3pLNJbc+r\nzmx4intP+38zfVpJlMlxWA5wwJpS7SANOHzP+21JaKsJor2U7QcvFgRhxCxg\nVQqu\r\n=iBLi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","types":"lib/index.d.ts","module":"mjs/index.mjs","gitHead":"fa5d764b31d5e6d51a9b29d105b7aed45782551e","scripts":{"flow":"flow","link":"yarn build && yarn link graphql-compose && yarn link graphql-compose-connection && yarn link graphql-compose-pagination && yarn link mongoose && yarn link","lint":"npm run eslint && npm run tslint","test":"npm run coverage && npm run lint && npm run flow && npm run tscheck","build":"npm run build-lib && npm run build-mjs && npm run build-es && npm run build-node8 && npm run build-ts","watch":"jest --watch","eslint":"eslint --ext .js ./src","tslint":"tslint -p .","unlink":"rimraf node_modules && yarn install","tscheck":"tsc --noEmit","build-es":"rimraf es && BABEL_ENV=es babel src --ignore __tests__,__mocks__ -d es && COPY_TO_FOLDER=es npm run build-flow","build-ts":"find ./src -name '*.d.ts' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`; done","coverage":"jest --coverage --maxWorkers 4","build-lib":"rimraf lib && BABEL_ENV=cjs babel src --ignore __tests__,__mocks__ -d lib && COPY_TO_FOLDER=lib npm run build-flow","build-mjs":"rimraf mjs && BABEL_ENV=mjs babel src --ignore __tests__,__mocks__ -d mjs && yarn build-mjs-rename && COPY_TO_FOLDER=mjs npm run build-flow","build-flow":"echo `$1` && find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`.flow; done","build-node8":"rimraf node8 && BABEL_ENV=node8 babel src --ignore __tests__,__mocks__ -d node8 && COPY_TO_FOLDER=node8 npm run build-flow","build-mjs-rename":"find ./mjs -name \"*.js\" -exec sh -c 'mv \"$1\" \"${1%.js}\".mjs' - '{}' \\;","semantic-release":"semantic-release"},"_npmUser":{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},"repository":{"url":"git+https://github.com/graphql-compose/graphql-compose-mongoose.git","type":"git"},"_npmVersion":"6.5.0","description":"Plugin for `graphql-compose` which derive a graphql types from a mongoose model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"object-path":"^0.11.4","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.8.0","eslint":"^5.16.0","rimraf":"^2.6.3","tslint":"^5.17.0","graphql":"14.3.1","request":"^2.88.0","flow-bin":"^0.100.0","mongoose":"^5.5.12","prettier":"^1.17.1","@babel/cli":"^7.4.4","babel-core":"^7.0.0-bridge.0","babel-jest":"^24.8.0","typescript":"^3.5.1","@babel/core":"^7.4.5","babel-eslint":"^10.0.1","@types/graphql":"^14.2.0","@types/mongoose":"5.5.5","graphql-compose":"^7.1.0","semantic-release":"^15.13.12","@babel/preset-env":"^7.4.5","@babel/preset-flow":"^7.0.0","eslint-plugin-import":"^2.17.3","mongodb-memory-server":"^5.1.2","eslint-config-prettier":"^4.3.0","eslint-plugin-flowtype":"^3.9.1","eslint-plugin-prettier":"^3.1.0","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","eslint-config-airbnb-base":"^13.1.0","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-transform-flow-strip-types":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"peerDependencies":{"mongoose":"^5.0.0 || ^4.4.0","graphql-compose":"^7.1.0"},"optionalDependencies":{"graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/graphql-compose-mongoose_0.0.2_1560366886079_0.5802168801555483","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@anthor/graphql-compose-mongoose","version":"0.0.3","keywords":["graphql","compose","graphql-compose","mongoose","mongodb"],"license":"MIT","_id":"@anthor/graphql-compose-mongoose@0.0.3","maintainers":[{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},{"name":"solrac0","email":"carlosh.guimaraes@hotmail.com"},{"name":"vytorcalixto","email":"vytorcalixto@gmail.com"},{"name":"wmenegali","email":"wmenegali@gmail.com"},{"name":"zeowna","email":"joselucaschociai@gmail.com"}],"contributors":[{"name":"Pavel Chertorogov","email":"pavel.chertorogov@gmail.com"}],"homepage":"https://github.com/graphql-compose/graphql-compose-mongoose","bugs":{"url":"https://github.com/graphql-compose/graphql-compose-mongoose/issues"},"dist":{"shasum":"8a02ba551b947a669a4f814f46fbd2610fb2dc21","tarball":"https://registry.npmjs.org/@anthor/graphql-compose-mongoose/-/graphql-compose-mongoose-0.0.3.tgz","fileCount":577,"integrity":"sha512-eEdoQoXpif3Riz+FoPmea7jXj08WL/Bn+6pa9+nlOdwFcjMzquxREe4PdlYwMjXWP8e12PoofB5rfulh8gV1SA==","signatures":[{"sig":"MEQCIHciO0pzZO336a51bH1SQ2FDAZxqnDVl+YW3rhw1a0JFAiB7gy73De4W33htv1FsBiUaiDvPyZQRbJKGdPKS/PqJAg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1899326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAW1BCRA9TVsSAnZWagAAXeMP/1V6p4EXj7DvXS8PRaME\nk4tjlOD7/9R3FuqtPTvqbByylCjtiupLAPiZZ95yzIp9iVDc+7nbkm9KKRO3\nYTubYDI8JKNXxtsjQsCgDupiESfc0rw/BPsmYE5Kq5tpYDRZn+Q/5YJfeRnH\nzEH91Rho8CgXdnjIDEfi7DhFfKgMTrdSWXgb6q9JpUfnx5b7YJrrXPpJ5TDk\nL0ORVHjOOOO5bUfOSaDstttt+dfOWXyRq1CsJh9mbR0d7FOe3zFL1iZqnFYA\nxZEpwA+ksAj2sbZg4kPSWR6Z8q8lGRx4idB+CaJ277l1XvTTt6QxtvVfaSBx\n9N3zR33Nn0stBp9kyvNTFpG7HO2R+G7rzL5nMoZEt+5vjOjOFEOKqnvx04bD\nOa4256iiXHpx5Vm+5z6D9y+Gn3lszw7j2AIMTMeyjsy1y4TyTy9QQ1Vbg8iy\nhQCeWycgvLlmMSpR57KsHtTB7gKVDbLBu5zuIjqd86gwGozWNLwtsaijtxAE\nrCdsFpAkZJ2TxpObEvydAlox8ab+3/6hyNGaldVwtr0YrKSDRp5yjvzMj3Z3\npu/wOgOqdpj0DOS9htlT+ZhUGobmkl0c5i2alhAyR3XXbIhx97qdzAideoWN\njmFIJRQtvqBBi8jE7PIyjsSkcASs7DXQ1LIdRk2jgzABQl15k66qAr04eN4v\nSvWK\r\n=c5M0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","types":"lib/index.d.ts","module":"mjs/index.mjs","gitHead":"1a70cb02a14b27f1b8a549b4bbb44c2bb4d16338","scripts":{"flow":"flow","link":"yarn build && yarn link graphql-compose && yarn link graphql-compose-connection && yarn link graphql-compose-pagination && yarn link mongoose && yarn link","lint":"npm run eslint && npm run tslint","test":"npm run coverage && npm run lint && npm run flow && npm run tscheck","build":"npm run build-lib && npm run build-mjs && npm run build-es && npm run build-node8 && npm run build-ts","watch":"jest --watch","eslint":"eslint --ext .js ./src","tslint":"tslint -p .","unlink":"rimraf node_modules && yarn install","tscheck":"tsc --noEmit","build-es":"rimraf es && BABEL_ENV=es babel src --ignore __tests__,__mocks__ -d es && COPY_TO_FOLDER=es npm run build-flow","build-ts":"find ./src -name '*.d.ts' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`; done","coverage":"jest --coverage --maxWorkers 4","build-lib":"rimraf lib && BABEL_ENV=cjs babel src --ignore __tests__,__mocks__ -d lib && COPY_TO_FOLDER=lib npm run build-flow","build-mjs":"rimraf mjs && BABEL_ENV=mjs babel src --ignore __tests__,__mocks__ -d mjs && yarn build-mjs-rename && COPY_TO_FOLDER=mjs npm run build-flow","build-flow":"echo `$1` && find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`.flow; done","build-node8":"rimraf node8 && BABEL_ENV=node8 babel src --ignore __tests__,__mocks__ -d node8 && COPY_TO_FOLDER=node8 npm run build-flow","build-mjs-rename":"find ./mjs -name \"*.js\" -exec sh -c 'mv \"$1\" \"${1%.js}\".mjs' - '{}' \\;","semantic-release":"semantic-release"},"_npmUser":{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},"repository":{"url":"git+https://github.com/graphql-compose/graphql-compose-mongoose.git","type":"git"},"_npmVersion":"6.5.0","description":"Plugin for `graphql-compose` which derive a graphql types from a mongoose model.","directories":{},"_nodeVersion":"12.4.0","dependencies":{"object-path":"^0.11.4","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.8.0","eslint":"^5.16.0","rimraf":"^2.6.3","tslint":"^5.17.0","graphql":"14.3.1","request":"^2.88.0","flow-bin":"^0.100.0","mongoose":"^5.5.12","prettier":"^1.17.1","@babel/cli":"^7.4.4","babel-core":"^7.0.0-bridge.0","babel-jest":"^24.8.0","typescript":"^3.5.1","@babel/core":"^7.4.5","babel-eslint":"^10.0.1","@types/graphql":"^14.2.0","@types/mongoose":"5.5.5","graphql-compose":"^7.1.0","semantic-release":"^15.13.12","@babel/preset-env":"^7.4.5","@babel/preset-flow":"^7.0.0","eslint-plugin-import":"^2.17.3","mongodb-memory-server":"^5.1.2","eslint-config-prettier":"^4.3.0","eslint-plugin-flowtype":"^3.9.1","eslint-plugin-prettier":"^3.1.0","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","eslint-config-airbnb-base":"^13.1.0","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-transform-flow-strip-types":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"peerDependencies":{"mongoose":"^5.0.0 || ^4.4.0","graphql-compose":"^7.1.0"},"optionalDependencies":{"graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/graphql-compose-mongoose_0.0.3_1560374592228_0.05021034853719919","host":"s3://npm-registry-packages"}},"0.0.4-rc":{"name":"@anthor/graphql-compose-mongoose","version":"0.0.4-rc","keywords":["graphql","compose","graphql-compose","mongoose","mongodb"],"license":"MIT","_id":"@anthor/graphql-compose-mongoose@0.0.4-rc","maintainers":[{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},{"name":"solrac0","email":"carlosh.guimaraes@hotmail.com"},{"name":"vytorcalixto","email":"vytorcalixto@gmail.com"},{"name":"wmenegali","email":"wmenegali@gmail.com"},{"name":"zeowna","email":"joselucaschociai@gmail.com"}],"contributors":[{"name":"Pavel Chertorogov","email":"pavel.chertorogov@gmail.com"}],"homepage":"https://github.com/graphql-compose/graphql-compose-mongoose","bugs":{"url":"https://github.com/graphql-compose/graphql-compose-mongoose/issues"},"dist":{"shasum":"3ee29496e8fc865340429f892938ea6772562e30","tarball":"https://registry.npmjs.org/@anthor/graphql-compose-mongoose/-/graphql-compose-mongoose-0.0.4-rc.tgz","fileCount":586,"integrity":"sha512-u0ymTmsrXwZr8kAst9tjwIVm8wdW/ebHqK7yso+iDA/9GvCMj5q6jJjD850S9JYH9BOkXE0/v1qmG7rhtKKDbQ==","signatures":[{"sig":"MEYCIQD3EQSsxojY+guRnmddf6L3JdxBL6zyIJzTws5DKFeP2QIhAJwegCeVLTito2Ywuasi47KYfH35b28DHMp6EQNJ5yhW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1913855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxbmdCRA9TVsSAnZWagAAgfgP/0bREpbV/it4syhYt7+R\n3JvMT7wzv5ndBelNNtQvjUm+br6fFpvm890NdyVTL/tqJzjDH4d9T75ZMOnU\nOwmxu2g5MYfWt2/VtEwBJZ8hMqZ7gn8yWApQnLHbuhn9quknvH+Rj7dQBmaE\nvYVqK6P28FQ9ZsIyMNYbt5+zTHX0EhmSRZVbO1rsoxy6h042NYa2lixxLcng\nwOfPtcmczGugEuK5XLmi9XhvLCAbinNxvrLvWUdQmNmSQaeNiyP9tBvgzPma\nSxSkpQKvA51VfW9yzR4ZVV1MXUUkzZcVGbsQy6ooeepfHDFLUsdFZDPGYAz1\nQaQjytVd0J/MRJdPXfKTHqVRjFI3oK+1lZjypoFf0KtBH9d6k9X92usUsV9p\nbwB+yr2zCkCZAZdj4evPBONKrDjzgtINX+OPq5kgEuWXvx+7AzEa21vimQ14\nSxy+Y2BvcxD479/rylWxql2tXKr+rDOFt1Dnrt0TiJnNGyvoKNwb0H5hqYsI\n/jmoqKVRRW+G3hYNVq5WyMWrM9qmkUYF0ft2AdPXhLLXRM7bkMpsW8lozeUD\n7jVwl8o+vCDjY+PA4QNxKKWNboWatAHqcPqBEBpRE7ykherXJES9IOapgNXa\n+rFH3LSmk6QsfJ6907xbUv5NIk7v1GVomflKCq0j6ezOcUA+ODcz2EXXLoxn\ns4ma\r\n=hmK4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","types":"lib/index.d.ts","module":"mjs/index.mjs","gitHead":"8e6ce8678b8efc4a8b54abf4ca4361ccec4397a9","scripts":{"flow":"flow","link":"yarn build && yarn link graphql-compose && yarn link graphql-compose-connection && yarn link graphql-compose-pagination && yarn link mongoose && yarn link","lint":"npm run eslint && npm run tslint","test":"npm run coverage && npm run lint && npm run flow && npm run tscheck","build":"npm run build-lib && npm run build-mjs && npm run build-es && npm run build-node8 && npm run build-ts","watch":"jest --watch","eslint":"eslint --ext .js ./src","tslint":"tslint -p .","unlink":"rimraf node_modules && yarn install","tscheck":"tsc --noEmit","build-es":"rimraf es && BABEL_ENV=es babel src --ignore __tests__,__mocks__ -d es && COPY_TO_FOLDER=es npm run build-flow","build-ts":"find ./src -name '*.d.ts' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`; done","coverage":"jest --coverage --maxWorkers 4","build-lib":"rimraf lib && BABEL_ENV=cjs babel src --ignore __tests__,__mocks__ -d lib && COPY_TO_FOLDER=lib npm run build-flow","build-mjs":"rimraf mjs && BABEL_ENV=mjs babel src --ignore __tests__,__mocks__ -d mjs && yarn build-mjs-rename && COPY_TO_FOLDER=mjs npm run build-flow","build-flow":"echo `$1` && find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`.flow; done","build-node8":"rimraf node8 && BABEL_ENV=node8 babel src --ignore __tests__,__mocks__ -d node8 && COPY_TO_FOLDER=node8 npm run build-flow","build-mjs-rename":"find ./mjs -name \"*.js\" -exec bash -c 'mv \"$1\" \"${1%.js}\".mjs' - '{}' \\;","semantic-release":"semantic-release"},"_npmUser":{"name":"freitasmurillo","email":"murillobrendelfreitas@gmail.com"},"repository":{"url":"git+https://github.com/graphql-compose/graphql-compose-mongoose.git","type":"git"},"_npmVersion":"6.4.1","description":"Plugin for `graphql-compose` which derive a graphql types from a mongoose model.","directories":{},"_nodeVersion":"8.16.2","dependencies":{"object-path":"^0.11.4","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.8.0","eslint":"^5.16.0","rimraf":"^2.6.3","tslint":"^5.17.0","graphql":"14.3.1","request":"^2.88.0","flow-bin":"^0.100.0","mongoose":"^5.5.12","prettier":"^1.17.1","@babel/cli":"^7.4.4","babel-core":"^7.0.0-bridge.0","babel-jest":"^24.8.0","typescript":"^3.5.1","@babel/core":"^7.4.5","babel-eslint":"^10.0.1","@types/graphql":"^14.2.0","@types/mongoose":"5.5.5","graphql-compose":"^7.1.0","semantic-release":"^15.13.12","@babel/preset-env":"^7.4.5","@babel/preset-flow":"^7.0.0","eslint-plugin-import":"^2.17.3","mongodb-memory-server":"^5.1.2","eslint-config-prettier":"^4.3.0","eslint-plugin-flowtype":"^3.9.1","eslint-plugin-prettier":"^3.1.0","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","eslint-config-airbnb-base":"^13.1.0","graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3","@babel/plugin-transform-runtime":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-transform-flow-strip-types":"^7.4.4","@babel/plugin-proposal-object-rest-spread":"^7.4.4"},"peerDependencies":{"mongoose":"^5.0.0 || ^4.4.0","graphql-compose":"^7.1.0"},"optionalDependencies":{"graphql-compose-connection":"^6.0.3","graphql-compose-pagination":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/graphql-compose-mongoose_0.0.4-rc_1573239196619_0.5505245441233777","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-06-12T18:45:16.202Z","modified":"2025-12-16T20:44:10.285Z","0.0.1":"2019-06-12T18:45:16.579Z","0.0.2-rc.1":"2019-06-12T18:59:26.491Z","0.0.2":"2019-06-12T19:14:46.250Z","0.0.3":"2019-06-12T21:23:12.427Z","0.0.4-rc":"2019-11-08T18:53:16.842Z"},"bugs":{"url":"https://github.com/graphql-compose/graphql-compose-mongoose/issues"},"license":"MIT","homepage":"https://github.com/graphql-compose/graphql-compose-mongoose","keywords":["graphql","compose","graphql-compose","mongoose","mongodb"],"repository":{"url":"git+https://github.com/graphql-compose/graphql-compose-mongoose.git","type":"git"},"description":"Plugin for `graphql-compose` which derive a graphql types from a mongoose model.","contributors":[{"name":"Pavel Chertorogov","email":"pavel.chertorogov@gmail.com"}],"maintainers":[{"email":"developer@anthor.com","name":"developer-anthor"},{"email":"paulodrade@gmail.com","name":"paulodrade"}],"readme":"# graphql-compose-mongoose\n\n[![travis build](https://img.shields.io/travis/graphql-compose/graphql-compose-mongoose.svg)](https://travis-ci.org/graphql-compose/graphql-compose-mongoose)\n[![codecov coverage](https://img.shields.io/codecov/c/github/graphql-compose/graphql-compose-mongoose.svg)](https://codecov.io/github/graphql-compose/graphql-compose-mongoose)\n[![npm](https://img.shields.io/npm/v/graphql-compose-mongoose.svg)](https://www.npmjs.com/package/graphql-compose-mongoose)\n[![trends](https://img.shields.io/npm/dt/graphql-compose-mongoose.svg)](http://www.npmtrends.com/graphql-compose-mongoose)\n[![Join the chat at https://gitter.im/graphql-compose/Lobby](https://badges.gitter.im/graphql-compose/graphql-compose.svg)](https://gitter.im/graphql-compose/Lobby)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Greenkeeper badge](https://badges.greenkeeper.io/graphql-compose/graphql-compose-mongoose.svg)](https://greenkeeper.io/)\n\nThis is a plugin for [graphql-compose](https://github.com/graphql-compose/graphql-compose), which derives GraphQLType from your [mongoose model](https://github.com/Automattic/mongoose). Also derives bunch of internal GraphQL Types. Provide all CRUD resolvers, including `graphql connection`, also provided basic search via operators ($lt, $gt and so on).\n\n## Installation\n\n```bash\nnpm install graphql graphql-compose mongoose graphql-compose-mongoose --save\n```\n\nModules `graphql`, `graphql-compose`, `mongoose` are in `peerDependencies`, so should be installed explicitly in your app. They have global objects and should not have ability to be installed as submodule.\n\nIf you want to add additional resolvers [`connection`](https://github.com/graphql-compose/graphql-compose-connection) and/or [`pagination`](https://github.com/graphql-compose/graphql-compose-pagination) - just install following packages and `graphql-compose-mongoose` will add them automatically.\n\n```bash\nnpm install graphql-compose-connection graphql-compose-pagination --save\n```\n\n### Different builds\n\nThis library contains different builds for any purposes:\n\n```js\n// Default import for using under node v6 and above\nimport { composeWithMongoose } from 'graphql-compose-mongoose';\n\n// For using node 8 and above (native async/await)\nimport { composeWithMongoose } from 'graphql-compose-mongoose/node8';\n\n// Source code without Flowtype declarations\nimport { composeWithMongoose } from 'graphql-compose-mongoose/es';\n```\n\n## Example\n\nLive demo: [https://graphql-compose.herokuapp.com/](https://graphql-compose.herokuapp.com/)\n\nSource code: https://github.com/graphql-compose/graphql-compose-examples\n\nSmall explanation for variables naming:\n\n- `UserSchema` - this is a mongoose schema\n- `User` - this is a mongoose model\n- `UserTC` - this is a `ObjectTypeComposer` instance for User. `ObjectTypeComposer` has `GraphQLObjectType` inside, avaliable via method `UserTC.getType()`.\n- Here and in all other places of code variables suffix `...TC` means that this is `ObjectTypeComposer` instance, `...ITC` - `InputTypeComposer`, `...ETC` - `EnumTypeComposer`.\n\n```js\nimport mongoose from 'mongoose';\nimport { composeWithMongoose } from 'graphql-compose-mongoose';\nimport { schemaComposer } from 'graphql-compose';\n\n// STEP 1: DEFINE MONGOOSE SCHEMA AND MODEL\nconst LanguagesSchema = new mongoose.Schema({\n  language: String,\n  skill: {\n    type: String,\n    enum: [ 'basic', 'fluent', 'native' ],\n  },\n});\n\nconst UserSchema = new mongoose.Schema({\n  name: String, // standard types\n  age: {\n    type: Number,\n    index: true,\n  },\n  languages: {\n    type: [LanguagesSchema], // you may include other schemas (here included as array of embedded documents)\n    default: [],\n  },\n  contacts: { // another mongoose way for providing embedded documents\n    email: String,\n    phones: [String], // array of strings\n  },\n  gender: { // enum field with values\n    type: String,\n    enum: ['male', 'female', 'ladyboy'],\n  },\n  someMixed: {\n    type: mongoose.Schema.Types.Mixed,\n    description: 'Can be any mixed type, that will be treated as JSON GraphQL Scalar Type',\n  },\n});\nconst User = mongoose.model('User', UserSchema);\n\n\n\n// STEP 2: CONVERT MONGOOSE MODEL TO GraphQL PIECES\nconst customizationOptions = {}; // left it empty for simplicity, described below\nconst UserTC = composeWithMongoose(User, customizationOptions);\n\n// STEP 3: Add needed CRUD User operations to the GraphQL Schema\n// via graphql-compose it will be much much easier, with less typing\nschemaComposer.Query.addFields({\n  userById: UserTC.getResolver('findById'),\n  userByIds: UserTC.getResolver('findByIds'),\n  userOne: UserTC.getResolver('findOne'),\n  userMany: UserTC.getResolver('findMany'),\n  userCount: UserTC.getResolver('count'),\n  userConnection: UserTC.getResolver('connection'),\n  userPagination: UserTC.getResolver('pagination'),\n});\n\nschemaComposer.Mutation.addFields({\n  userCreateOne: UserTC.getResolver('createOne'),\n  userCreateMany: UserTC.getResolver('createMany'),\n  userUpdateById: UserTC.getResolver('updateById'),\n  userUpdateOne: UserTC.getResolver('updateOne'),\n  userUpdateMany: UserTC.getResolver('updateMany'),\n  userRemoveById: UserTC.getResolver('removeById'),\n  userRemoveOne: UserTC.getResolver('removeOne'),\n  userRemoveMany: UserTC.getResolver('removeMany'),\n});\n\nconst graphqlSchema = schemaComposer.buildSchema();\nexport default graphqlSchema;\n```\n\nThat's all!\nYou think that is to much code?\nI don't think so, because by default internally was created about 55 graphql types (for input, sorting, filtering). So you will need much much more lines of code to implement all these CRUD operations by hands.\n\n### Working with Mongoose Collection Level Discriminators\n\nVariable Namings\n\n- `...DTC` - Suffix for a `DiscriminatorTypeComposer` instance, which is also an instance of `ObjectTypeComposer`. All fields and Relations manipulations on this instance affects all registered discriminators and the Discriminator Interface.\n\n```js\n  import mongoose from 'mongoose';\n  import { schemaComposer } from 'graphql-compose';\n  import { composeWithMongooseDiscriminators } from 'graphql-compose-mongoose';\n\n  // pick a discriminatorKey\n  const DKey = 'type';\n\n  const enumCharacterType = {\n    PERSON: 'Person',\n    DROID: 'Droid',\n  };\n\n  // DEFINE BASE SCHEMA\n  const CharacterSchema = new mongoose.Schema({\n    // _id: field...\n    type: {\n      type: String,\n      require: true,\n      enum: (Object.keys(enumCharacterType): Array<string>),\n      description: 'Character type Droid or Person',\n    },\n\n    name: String,\n    height: Number,\n    mass: Number,\n    films: [String],\n  });\n\n  // DEFINE DISCRIMINATOR SCHEMAS\n  const DroidSchema = new mongoose.Schema({\n    makeDate: String,\n    primaryFunction: [String],\n  });\n\n  const PersonSchema = new mongoose.Schema({\n    gender: String,\n    hairColor: String,\n    starships: [String],\n  });\n\n  // set discriminator Key\n  CharacterSchema.set('discriminatorKey', DKey);\n\n  // create base Model\n  const CharacterModel = mongoose.model('Character', CharacterSchema);\n\n  // create mongoose discriminator models\n  const DroidModel = CharacterModel.discriminator(enumCharacterType.DROID, DroidSchema);\n  const PersonModel = CharacterModel.discriminator(enumCharacterType.PERSON, PersonSchema);\n\n  // create DiscriminatorTypeComposer\n  const baseOptions = { // regular TypeConverterOptions, passed to composeWithMongoose\n    fields: {\n      remove: ['friends'],\n    }\n  }\n  const CharacterDTC = composeWithMongooseDiscriminators(CharacterModel, baseOptions);\n\n  // create Discriminator Types\n  const droidTypeConverterOptions = {  // this options will be merged with baseOptions -> customisationsOptions\n    fields: {\n      remove: ['makeDate'],\n    }\n  };\n  const DroidTC = CharacterDTC.discriminator(DroidModel, droidTypeConverterOptions);\n  const PersonTC = CharacterDTC.discriminator(PersonModel);  // baseOptions -> customisationsOptions applied\n\n  // You may now use CharacterDTC to add fields to all Discriminators\n  // Use DroidTC, `PersonTC as any other ObjectTypeComposer.\n  schemaComposer.Mutation.addFields({\n    droidCreate: DroidTC.getResolver('createOne'),\n    personCreate: PersonTC.getResolver('createOne'),\n  });\n\n  const schema = schemaComposer.buildSchema();\n\n  describe('createOne', () => {\n    it('should create child document without specifying DKey', async () => {\n      const res = await graphql.graphql(\n        schema,\n        `mutation CreateCharacters {\n          droidCreate(record: {name: \"Queue XL\", modelNumber: 360 }) {\n            record {\n              __typename\n              type\n              name\n              modelNumber\n            }\n          }\n\n          personCreate(record: {name: \"mernxl\", dob: 57275272}) {\n            record {\n              __typename\n              type\n              name\n              dob\n            }\n          }\n        }`\n      );\n\n      expect(res).toEqual({\n        data: {\n          droidCreate: {\n            record: { __typename: 'Droid', type: 'Droid', name: 'Queue XL', modelNumber: 360 },\n          },\n          personCreate: {\n            record: { __typename: 'Person', type: 'Person', name: 'mernxl', dob: 57275272 },\n          },\n        },\n      });\n    });\n  });\n```\n\n## FAQ\n\n### Can I get generated vanilla GraphQL types?\n\n```js\nconst UserTC = composeWithMongoose(User);\nUserTC.getType(); // returns GraphQLObjectType\nUserTC.getInputType(); // returns GraphQLInputObjectType, eg. for args\nUserTC.get('languages').getType(); // get GraphQLObjectType for nested field\nUserTC.get('fieldWithNesting.subNesting').getType(); // get GraphQL type of deep nested field\n```\n\n### How to add custom fields?\n\n```js\nUserTC.addFields({\n  lonLat: ObjectTypeComposer.create('type LonLat { lon: Float, lat: Float }'),\n  notice: 'String', // shorthand definition\n  noticeList: { // extended\n    type: '[String]', // String, Int, Float, Boolean, ID, Json\n    description: 'Array of notices',\n    resolve: (source, args, context, info) => 'some value',\n  },\n  bio: {\n    type: GraphQLString,\n    description: 'Providing vanilla GraphQL type'\n  }\n})\n```\n\n### How to build nesting/relations?\n\nSuppose you `User` model has `friendsIds` field with array of user ids. So let build some relations:\n\n```js\nUserTC.addRelation(\n  'friends',\n  {\n    resolver: () => UserTC.getResolver('findByIds'),\n    prepareArgs: { // resolver `findByIds` has `_ids` arg, let provide value to it\n      _ids: (source) => source.friendsIds,\n    },\n    projection: { friendsIds: 1 }, // point fields in source object, which should be fetched from DB\n  }\n);\nUserTC.addRelation(\n  'adultFriendsWithSameGender',\n  {\n    resolver: () => UserTC.get('$findMany'), // shorthand for `UserTC.getResolver('findMany')`\n    prepareArgs: { // resolver `findMany` has `filter` arg, we may provide mongoose query to it\n      filter: (source) => ({\n        _operators : { // Applying criteria on fields which have\n                       // operators enabled for them (by default, indexed fields only)\n          _id : { in: source.friendsIds },\n          age: { gt: 21 }\n        },\n        gender: source.gender,\n      }),\n      limit: 10,\n    },\n    projection: { friendsIds: 1, gender: 1 }, // required fields from source object\n  }\n);\n```\n\n### Reusing the same mongoose Schema in embedded object fields\n\nSuppose you have a common structure you use as embedded object in multiple Schemas.\nAlso suppose you want the structure to have the same GraphQL type across all parent types.\n(For instance, to allow reuse of fragments for this type)\nHere are Schemas to demonstrate:\n\n```js\nimport { Schema } from 'mongoose';\n\nconst ImageDataStructure = Schema({\n  url: String,\n  dimensions : {\n    width: Number,\n    height: Number\n  }\n}, { _id: false });\n\nconst UserProfile = Schema({\n  fullName: String,\n  personalImage: ImageDataStructure\n});\n\nconst Article = Schema({\n  title: String,\n  heroImage: ImageDataStructure\n});\n```\n\nIf you want the `ImageDataStructure` to use the same GraphQL type in both `Article` and `UserProfile` you will need create it as a mongoose schema (not a standard javascript object) and to explicitly tell `graphql-compose-mongoose` the name you want it to have. Otherwise, without the name, it would generate the name according to the first parent this type was embedded in.\n\nDo the following:\n\n```js\nimport { schemaComposer } from 'graphql-compose'; // get the default schemaComposer or your created schemaComposer\nimport { convertSchemaToGraphQL } from 'graphql-compose-mongoose';\n\nconvertSchemaToGraphQL(ImageDataStructure, 'EmbeddedImage', schemaComposer); // Force this type on this mongoose schema\n```\n\nBefore continuing to convert your models to TypeComposers:\n\n```js\nimport mongoose from 'mongoose';\nimport { composeWithMongoose } from 'graphql-compose-mongoose';\n\nconst UserProfile = mongoose.model('UserProfile', UserProfile);\nconst Article = mongoose.model('Article', Article);\n\nconst UserProfileTC = composeWithMongoose(UserProfile);\nconst ArticleTC = composeWithMongoose(Article);\n```\n\nThen, you can use queries like this:\n\n```graphql\nquery {\n  topUser {\n    fullName\n    personalImage {\n      ...fullImageData\n    }\n  }\n  topArticle {\n    title\n    heroImage {\n      ...fullImageData\n    }\n  }\n}\nfragment fullImageData on EmbeddedImage {\n  url\n  dimensions {\n    width height\n  }\n}\n```\n\n### Access and modify mongoose doc before save\n\nThis library provides some amount of ready resolvers for fetch and update data which was mentioned above. And you can [create your own resolver](https://github.com/graphql-compose/graphql-compose) of course. However you can find that add some actions or light modifications of mongoose document directly before save at existing resolvers appears more simple than create new resolver. Some of resolvers accepts *before save hook* which can be provided in *resolver params* as param named `beforeRecordMutate`. This hook allows to have access and modify mongoose document before save. The resolvers which supports this hook are:\n\n- createOne\n- createMany\n- removeById\n- removeOne\n- updateById\n- updateOne\n\nThe prototype of before save hook:\n\n```js\n(doc: mixed, rp: ResolverResolveParams) => Promise<*>,\n```\n\nThe typical implementation may be like this:\n\n```js\n// extend resolve params with hook\nrp.beforeRecordMutate = async function(doc, rp) {\n  doc.userTouchedAt = new Date();\n\n  const canMakeUpdate  = await performAsyncTask( ...provide data from doc... )\n  if (!canMakeUpdate) {\n    throw new Error('Forbidden!');\n  }\n\n  return doc;\n}\n```\n\nYou can provide your implementation directly in type composer:\n\n```js\nUserTC.wrapResolverResolve('updateById', next => async rp => {\n\n  // extend resolve params with hook\n  rp.beforeRecordMutate = async (doc, resolveParams) => { ... };\n\n  return next(rp);\n});\n```\n\nor you can create wrappers for example to protect access:\n\n```js\nfunction adminAccess(resolvers) {\n  Object.keys(resolvers).forEach((k) => {\n    resolvers[k] = resolvers[k].wrapResolve(next => async rp => {\n\n      // extend resolve params with hook\n      rp.beforeRecordMutate = async function(doc, rp) { ... }\n\n      return next(rp)\n    })\n  })\n  return resolvers\n}\n\n// and wrap the resolvers\nschemaComposer.Mutation.addFields({\n  createResource: ResourceTC.getResolver('createOne'),\n  createResources: ResourceTC.getResolver('createMany'),\n  ...adminAccess({\n    updateResource: ResourceTC.getResolver('updateById'),\n    removeResource: ResourceTC.getResolver('removeById'),\n  }),\n});\n```\n\n### How can I push/pop or add/remove values to arrays?\n\nThe default resolvers, by design, will replace (overwrite) any supplied array object when using e.g. `updateById`. If you want to push or pop a value in an array you can use a custom resolver with a native MongoDB call.\n\nFor example (push):-\n\n```js\n// Define new resolver 'pushToArray'\nUserTC.addResolver({\n  name: 'pushToArray',\n  type: UserTC,\n  args: { userId: 'MongoID!', valueToPush: 'String' },\n  resolve: async ({ source, args, context, info }) => {\n    const user = await User.update({ _id: args.userId }, { $push: { arrayToPushTo: args.valueToPush } } })\n    if (!user) return null // or gracefully return an error etc...\n    return User.findOne({ _id: args.userId }) // return the record\n  }\n})\n\n// Then add 'pushToArray' as a graphql field e.g.\nschemaComposer.Mutation.addFields({userPushToArray: UserTC.getResolver('pushToArray')})\n```\n\n`User` is the corresponding Mongoose model. If you do not wish to allow duplicates in the array then replace `$push` with `$addToSet`. Read the graphql-compose docs on custom resolvers for more info: https://graphql-compose.github.io/docs/en/basics-resolvers.html\n\nNB if you set `unique: true` on the array then using the `update` `$push` approach will not check for duplicates, this is due to a MongoDB bug: https://jira.mongodb.org/browse/SERVER-1068. For more usage examples with `$push` and arrays see the MongoDB docs here https://docs.mongodb.com/manual/reference/operator/update/push/. Also note that `$push` will preserve order in the array (append to end of array) whereas `$addToSet` will not.\n\n## Customization options\n\nWhen we convert model `const UserTC = composeWithMongoose(User, customizationOptions);` you may tune every piece of future derived types and resolvers.\n\n### Here is flow typed definition of this options:\n\nThe top level of customization options. Here you setup name and description for the main type, remove fields or leave only desired fields.\n\n```js\nexport type typeConverterOpts = {\n  name?: string,\n  description?: string,\n  fields?: {\n    only?: string[],\n    remove?: string[],\n  },\n  inputType?: typeConverterInputTypeOpts,\n  resolvers?: false | typeConverterResolversOpts,\n};\n```\n\nThis is `opts.inputType` level of options for default InputTypeObject which will be provided to all resolvers for `filter` and `input` args.\n\n```js\nexport type typeConverterInputTypeOpts = {\n  name?: string,\n  description?: string,\n  fields?: {\n    only?: string[],\n    remove?: string[],\n    required?: string[]\n  },\n};\n```\n\nThis is `opts.resolvers` level of options.\nIf you set the option to `false` it will disable resolver or some of its input args.\nEvery resolver's arg has it own options. They described below.\n\n```js\nexport type typeConverterResolversOpts = {\n  findById?: false,\n  findByIds?: false | {\n    limit?: limitHelperArgsOpts | false,\n    sort?: sortHelperArgsOpts | false,\n  },\n  findOne?: false | {\n    filter?: filterHelperArgsOpts | false,\n    sort?: sortHelperArgsOpts | false,\n    skip?: false,\n  },\n  findMany?: false | {\n    filter?: filterHelperArgsOpts | false,\n    sort?: sortHelperArgsOpts | false,\n    limit?: limitHelperArgsOpts | false,\n    skip?: false,\n  },\n  updateById?: false | {\n    record?: recordHelperArgsOpts | false,\n  },\n  updateOne?: false | {\n    record?: recordHelperArgsOpts | false,\n    filter?: filterHelperArgsOpts | false,\n    sort?: sortHelperArgsOpts | false,\n    skip?: false,\n  },\n  updateMany?: false | {\n    record?: recordHelperArgsOpts | false,\n    filter?: filterHelperArgsOpts | false,\n    sort?: sortHelperArgsOpts | false,\n    limit?: limitHelperArgsOpts | false,\n    skip?: false,\n  },\n  removeById?: false,\n  removeOne?: false | {\n    filter?: filterHelperArgsOpts | false,\n    sort?: sortHelperArgsOpts | false,\n  },\n  removeMany?: false | {\n    filter?: filterHelperArgsOpts | false,\n  },\n  createOne?: false | {\n    record?: recordHelperArgsOpts | false,\n  },\n  createMany?: false | {\n    records?: recordHelperArgsOpts | false,\n  },\n  count?: false | {\n    filter?: filterHelperArgsOpts | false,\n  },\n  connection?: false | {\n    uniqueFields: string[],\n    sortValue: mixed,\n    directionFilter: (<T>(filterArg: T, cursorData: CursorDataType, isBefore: boolean) => T),\n  },\n  pagination?: false | {\n    perPage?: number,\n  },\n};\n```\n\nThis is `opts.resolvers.[resolverName].[filter|sort|record|limit]` level of options.\nYou may tune every resolver's args independently as you wish.\nHere you may setup every argument and override some fields from the default input object type, described above in `opts.inputType`.\n\n```js\nexport type filterHelperArgsOpts = {\n  filterTypeName?: string, // type name for `filter`\n  isRequired?: boolean, // set `filter` arg as required (wraps in GraphQLNonNull)\n  onlyIndexed?: boolean, // leave only that fields, which is indexed in mongodb\n  requiredFields?: string | string[], // provide fieldNames, that should be required\n  operators?: filterOperatorsOpts | false, // provide filtering fields by operators, eg. $lt, $gt\n                                           // if left empty - provides all operators on indexed fields\n};\n\n// supported operators names in filter `arg`\nexport type filterOperatorNames =  'gt' | 'gte' | 'lt' | 'lte' | 'ne' | 'in[]' | 'nin[]';\nexport type filterOperatorsOpts = { [fieldName: string]: filterOperatorNames[] | false };\n\nexport type sortHelperArgsOpts = {\n  sortTypeName?: string, // type name for `sort`\n};\n\nexport type recordHelperArgsOpts = {\n  recordTypeName?: string, // type name for `record`\n  isRequired?: boolean, // set `record` arg as required (wraps in GraphQLNonNull)\n  removeFields?: string[], // provide fieldNames, that should be removed\n  requiredFields?: string[], // provide fieldNames, that should be required\n};\n\nexport type limitHelperArgsOpts = {\n  defaultValue?: number, // set your default limit, if it not provided in query (default: 1000)\n};\n```\n\n## Used plugins\n\n### [graphql-compose-connection](https://github.com/graphql-compose/graphql-compose-connection)\n\nThis plugin adds `connection` resolver. Build in mechanism allows sort by any unique indexes (not only by id). Also supported compound sorting (by several fields).\n\nBesides standard connection arguments `first`, `last`, `before` and `after`, also added great arguments:\n\n- `filter` arg - for filtering records\n- `sort` arg - for sorting records\n\nThis plugin completely follows to [Relay Cursor Connections Specification](https://facebook.github.io/relay/graphql/connections.htm).\n\n### [graphql-compose-pagination](https://github.com/graphql-compose/graphql-compose-pagination)\n\nThis plugin adds `pagination` resolver.\n\n## License\n\n[MIT](https://github.com/graphql-compose/graphql-compose-mongoose/blob/master/LICENSE.md)\n","readmeFilename":"README.md"}