{"id":14975609,"url":"https://github.com/skauffmann/apollo-mongoose-plugin","last_synced_at":"2026-02-17T04:31:40.017Z","repository":{"id":46651648,"uuid":"362414535","full_name":"skauffmann/apollo-mongoose-plugin","owner":"skauffmann","description":"Apollo GraphQL plugin to add MongoDB query information on the extensions node","archived":false,"fork":false,"pushed_at":"2021-10-01T15:18:23.000Z","size":233,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T23:39:03.340Z","etag":null,"topics":["apollo","apollo-plugin","hacktoberfest","mongodb","mongoose","mongoose-plugin","performance"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skauffmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-28T09:39:50.000Z","updated_at":"2022-11-08T23:05:19.000Z","dependencies_parsed_at":"2022-09-01T21:03:27.444Z","dependency_job_id":null,"html_url":"https://github.com/skauffmann/apollo-mongoose-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/skauffmann/apollo-mongoose-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skauffmann%2Fapollo-mongoose-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skauffmann%2Fapollo-mongoose-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skauffmann%2Fapollo-mongoose-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skauffmann%2Fapollo-mongoose-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skauffmann","download_url":"https://codeload.github.com/skauffmann/apollo-mongoose-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skauffmann%2Fapollo-mongoose-plugin/sbom","scorecard":{"id":829184,"data":{"date":"2025-08-11","repo":{"name":"github.com/skauffmann/apollo-mongoose-plugin","commit":"e06aa2566cb4791c17c7feddf1e3b2d343928260"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"31 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-vxvm-qww3-2fh7","Warn: Project is vulnerable to: GHSA-f825-f98c-gj3g","Warn: Project is vulnerable to: GHSA-h8hf-x3f4-xwgp","Warn: Project is vulnerable to: GHSA-9m93-w8w6-76hh","Warn: Project is vulnerable to: GHSA-m7xq-9374-9rvx","Warn: Project is vulnerable to: GHSA-vg7j-7cwx-8wgw","Warn: Project is vulnerable to: GHSA-p92x-r36w-9395","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T17:16:37.712Z","repository_id":46651648,"created_at":"2025-08-23T17:16:37.713Z","updated_at":"2025-08-23T17:16:37.713Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29533702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T03:01:11.216Z","status":"ssl_error","status_checked_at":"2026-02-17T03:00:31.803Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","apollo-plugin","hacktoberfest","mongodb","mongoose","mongoose-plugin","performance"],"created_at":"2024-09-24T13:52:16.845Z","updated_at":"2026-02-17T04:31:40.000Z","avatar_url":"https://github.com/skauffmann.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apollo Mongoose Plugin\n\n![npm version](https://badgen.net/npm/v/apollo-mongoose-plugin)\n![types](https://badgen.net/npm/types/apollo-mongoose-plugin)\n![license](https://badgen.net/npm/license/apollo-mongoose-plugin)\n![bundlephobia](https://badgen.net/bundlephobia/min/apollo-mongoose-plugin)\n\n[Apollo GraphQL plugin](https://www.apollographql.com/docs/apollo-server/integrations/plugins/) to add Mongodb query information on the `extensions` node.\n\nYou will have access to the queries executed by Mongoose and execution times directly from the GraphQL response as bellow:\n\n![Apollo Mongoose Plugin](doc/apollo-mongoose-plugin.png)\n\n## Installation\n\nIf you’re using npm:\n\n```bash\nnpm install apollo-mongoose-plugin\n```\n\nWith yarn:\n\n```bash\nyarn add apollo-mongoose-plugin\n```\n\n## Usage\n\nAdding the `apollo-mongoose-plugin` plugin to your project is done in 2 steps:\n\n1. **register the mongoose query collector plugin:** _it will add hooks to collect and measure execution times of your queries._\n2. **register the apollo plugin:** _it will use the previous query collector to return queries on the GraphQL response._\n\n```typescript\nimport {\n  ApolloMongoosePlugin,\n  mongoCollectorPlugin,\n} from 'apollo-mongoose-plugin';\nimport { ApolloServer } from 'apollo-server';\nimport mongoose from 'mongoose';\n\n// first: register mongoose query collector plugin\n// 🔔  Make sure you are registering the mongoose plugin\n//     before you are creating mongoose models\nmongoose.plugin(mongoCollectorPlugin);\n\n// then: register apollo plugin\nconst server = new ApolloServer({\n  // ...schema, dataSources\n  plugins: [new ApolloMongoosePlugin()],\n});\n```\n\n🚨 \u0026nbsp; Be aware that it is best not to activate this plugin in production. For example, you can do this:\n\n```typescript\nif (process.env.NODE_ENV !== 'production')\n  mongoose.plugin(mongoCollectorPlugin);\n\nconst server = new ApolloServer({\n  // ...schema, dataSources\n  plugins: [\n    process.env.NODE_ENV !== 'production' \u0026\u0026 new ApolloMongoosePlugin(),\n  ].filter(Boolean),\n});\n```\n\n## API\n\n### `ApolloMongoosePlugin`\n\nThis is the core plugin, that you register with Apollo Server.\n\n#### Options\n\n| Name               | Default                              | Description                                                                                                           |\n| ------------------ | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |\n| `formatMongoQuery` | `formatMongoQueryAsString`           | Function called to format queries in the GraphQL response. You can create your own by implementing `FormatMongoQuery` |\n| `mongoCollector`   | `MongooQueryCollector.getInstance()` | Instance of mongoose query collector                                                                                  |\n\n## Contributing\n\nYou want to help? That’s awesome!\n\nCheck out the details of our [contribution process](./CONTRIBUTING.md) (it’s fairly standard).\n\n## License and copyright\n\nThis library is © [Samuel Kauffmann](http://github.com/skauffmann) and is MIT licensed. See [LICENSE.md](./LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskauffmann%2Fapollo-mongoose-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskauffmann%2Fapollo-mongoose-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskauffmann%2Fapollo-mongoose-plugin/lists"}