{"id":25107496,"url":"https://github.com/enigmatis/polaris-core","last_synced_at":"2026-05-01T09:31:52.004Z","repository":{"id":36290465,"uuid":"218715929","full_name":"Enigmatis/polaris-core","owner":"Enigmatis","description":"Cool library that helps you create a graphql service integrated with type-orm \u0026 some API standards","archived":false,"fork":false,"pushed_at":"2023-01-04T23:50:22.000Z","size":3414,"stargazers_count":2,"open_issues_count":26,"forks_count":0,"subscribers_count":5,"default_branch":"development","last_synced_at":"2025-04-02T08:48:47.304Z","etag":null,"topics":["apollo-server","graphql","graphql-js","typeorm"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Enigmatis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-31T08:12:31.000Z","updated_at":"2024-09-30T09:29:18.000Z","dependencies_parsed_at":"2023-01-17T01:16:32.906Z","dependency_job_id":null,"html_url":"https://github.com/Enigmatis/polaris-core","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/Enigmatis/polaris-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enigmatis%2Fpolaris-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enigmatis%2Fpolaris-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enigmatis%2Fpolaris-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enigmatis%2Fpolaris-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Enigmatis","download_url":"https://codeload.github.com/Enigmatis/polaris-core/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enigmatis%2Fpolaris-core/sbom","scorecard":{"id":45948,"data":{"date":"2025-08-11","repo":{"name":"github.com/Enigmatis/polaris-core","commit":"b591eba1e95c2e49dc8899383b87cced9b60e14d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"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":"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":"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":"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":"Code-Review","score":3,"reason":"Found 2/6 approved changesets -- score normalized to 3","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":"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"95 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-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-j5g3-5c8r-7qfx","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-7gc6-qh9x-w6h8","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-vfrc-7r7c-w9mx","Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","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-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-pw54-mh39-w3hc","Warn: Project is vulnerable to: GHSA-xgh6-85xh-479p","Warn: Project is vulnerable to: GHSA-cwx2-736x-mf6w","Warn: Project is vulnerable to: GHSA-v39p-96qg-c8rf","Warn: Project is vulnerable to: GHSA-8v63-cqqc-6r2c","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-r2j6-p67h-q639","Warn: Project is vulnerable to: GHSA-x2pg-mjhr-2m5x","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-pf2j-9qmp-jqr2","Warn: Project is vulnerable to: GHSA-fx4w-v43j-vc45","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","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"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-14T22:45:44.529Z","repository_id":36290465,"created_at":"2025-08-14T22:45:44.530Z","updated_at":"2025-08-14T22:45:44.530Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32492132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-server","graphql","graphql-js","typeorm"],"created_at":"2025-02-07T23:48:15.095Z","updated_at":"2026-05-01T09:31:51.981Z","avatar_url":"https://github.com/Enigmatis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg height=\"190\" src=\"https://github.com/Enigmatis/polaris-nest-logger/raw/master/polarisen.png\" alt=\"polaris logo\" /\u003e\u003cbr\u003e\u003cbr\u003e\n    Create a graphql service easily, integrated with typeorm, middlewares, standard logs, and more!\u003cbr\u003e\u003cbr\u003e\n    \u003cimg alt=\"npm (scoped)\" src=\"https://img.shields.io/npm/v/@enigmatis/polaris-core\"\u003e\n    \u003cimg alt=\"npm (scoped with tag)\" src=\"https://img.shields.io/npm/v/@enigmatis/polaris-core/beta\"\u003e\n    \u003cimg alt=\"Travis (.org) branch\" src=\"https://travis-ci.com/Enigmatis/polaris-core.svg?branch=master\"\u003e\n    \u003ca href=\"https://www.codacy.com/gh/Enigmatis/polaris-core?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Enigmatis/polaris-core\u0026amp;utm_campaign=Badge_Grade\"\u003e\u003cimg src=\"https://api.codacy.com/project/badge/Grade/6a403edb43684b2382728837f58bbfbb\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# polaris-core\n\nPolaris is a set of libraries that help you create the perfect graphql service, integrated with type orm and the hottest API standards.\npolaris-core organizes all of the libraries for you, and let you create your graphql service as easily as it can be.\n\n## Features\n\n-   GraphQL service creation (integrated with apollo-server \u0026 express)\n-   Auto soft deletion of entities\n-   Fetching Deltas of entities (including irrelevant entities)\n-   Support realities\n-   Standard errors\n-   Standard logs\n-   Standard GraphQL scalars\n\n### PolarisServer\n\nThis is the server that you will use in order to create your own standardized GraphQL server.\\\n`PolarisServer` uses `ApolloServer` and starts the server with `Express`.\n\n### PolarisServerOptions\n\nThrough this interface you should set the following configurations which will be supplied to the `PolarisServer`:\n\n-   **typeDefs** (_any_) - The GraphQL schema written in SDL (Schema Definition Language).\n    This will be used in order to create your GraphQL API.\n-   **resolvers** (_any_) - The GraphQL resolvers that will be tied to your GraphQL schema.\n    This object contains functions and logic for the GraphQL engine to invoke when using fields from the schema.\n-   **port** (_number_) - Specify a port the `PolarisServer` should start the server on.\n-   **applicationProperties** (_ApplicationProperties - optional_) - Properties that describe your repository.\n    If you don't provide those properties, the core will put 'v1' in the version.\n-   **allowSubscription** (boolean - optional) - Responsible for creating a websocket endpoint for graphql subscriptions.\n-   **customMiddlewares** (_any[] - optional_) - Custom middlewares that can be provided the `PolarisServer` with.\n-   **customContext** (_(context: any, connection?: Connection) =\u003e any - optional_) - You can provide the `PolarisServer` your own custom context.\n    If you do not set your custom context, the core will use a default context.\n-   **loggerConfiguration** (_LoggerConfiguration - optional_) - This is an interface that defines the logger in the `PolarisServer`.\n    If you do not provide this property, the core will use default values for the logger.\n-   **middlewareConfiguration** (_MiddlewareConfiguration - optional_) - This is an interface that defines what core middlewares should be activated/disabled.\n-   **connection** (_Connection - optional_) - This class represents your connection with the database. Used in the core middlewares.\n-   **allowSubscription** (_boolean - optional_) - _Default: false._ Responsible for creating a websocket endpoint for graphql subscriptions.\n-   **shouldAddWarningsToExtensions** (_boolean - optional_) - _Default: true._ Specifies whether to return the warnings in the response extensions or not.\n-   **allowMandatoryHeaders** (_boolean - optional_) - _Default: false._ When set to true, every request must have `reality-id` and `requesting-sys` headers.\n\n### MiddlewareConfiguration\n\nAs mentioned above, this interface defines what core middlewares should be activated/disabled.\n\n-   **allowDataVersionAndIrrelevantEntitiesMiddleware** (_boolean_) - Determine if `DataVersionMiddleware` and `IrrelevantEntitiesMiddleware` should be applied to the request.\n-   **allowSoftDeleteMiddleware** (_boolean_) - Determine if `SoftDeleteMiddleware` should be applied to the request.\n-   **allowRealityMiddleware** (_boolean_) - Determine if `RealityMiddleware` should be applied to the request.\n\n### Custom context\n\nFirst we will define the new context type, pay attention that we just added a new field in the root of the context,\nand a new header in the request headers object.\n\n```typescript\nimport { PolarisGraphQLContext, PolarisRequestHeaders } from '@enigmatis/polaris-core';\n\ninterface CustomRequestHeaders extends PolarisRequestHeaders {\n    customHeader?: string | string[];\n}\n\nexport interface CustomContext extends PolarisGraphQLContext {\n    customField: number;\n    requestHeaders: CustomRequestHeaders;\n}\n```\n\nThen we will pass the custom context like this:\n\n```typescript\nimport { ExpressContext, PolarisServer } from '@enigmatis/polaris-core';\n\nconst typeDefs = `...`;\nconst resolvers = { ... };\n\nconst customContext = (context: ExpressContext): Partial\u003cCustomContext\u003e =\u003e {\n    const { req } = context;\n\n    return {\n        customField: 1000,\n        requestHeaders: {\n            customHeader: req.headers['custom-header'],\n        },\n    };\n};\n\nconst server = new PolarisServer({\n    typeDefs,\n    resolvers,\n    port: 8082,\n    customContext,\n});\n```\n\n### Subscriptions\n\nAdd the Subscription object to your schema\n\n```\nexport const typeDefs = `\n    type Query {\n        ...\n    }\n\n    type Mutation {\n        ...\n        updateBook(id: String!, newTitle: String!): [Book]!\n        ...\n    }\n\n    type Subscription {\n        bookUpdated: Book\n    }\n\n    type Book implements RepositoryEntity {\n        ...\n    }\n`;\n\n```\n\nnow let's implement the subscription resolver logic\n\n```\nimport { PubSub } from '@enigmatis/polaris-core';\n\nconst pubsub = new PubSub();\nconst BOOK_UPDATED = 'BOOK_UPDATED';\n\nexport const resolvers = {\n    Query: { ... },\n    Mutation: { ... },\n    Subscription: {\n        bookUpdated: {\n            subscribe: () =\u003e pubsub.asyncIterator([BOOK_UPDATED]),\n        },\n    },\n};\n```\n\nand inside the updateBook resolver we will publish the book that got changed:\n\n```\npubsub.publish(BOOK_UPDATED, { bookUpdated: myBook })\n```\n\nWhen you create the server you have to allow subscriptions, so the server could create the endpoint\n\n```\nconst server = new PolarisServer({\n    typeDefs,\n    resolvers,\n    port: 8080,\n    allowSubscription: true,\n});\n```\n\nJust pay attention that in case you are using custom context as well, the subscription context will be different,\nyou can handle it like so:\n\n```\nconst customContext = (context: ExpressContext): Partial\u003cCustomContext\u003e =\u003e {\n    const { req, connection } = context;\n    const headers = req ? req.headers : connection?.context;\n\n    return {\n        customField: 1000,\n        requestHeaders: {\n            customHeader: headers['custom-header'],\n        },\n    };\n};\n```\n\n### Warnings\n\nIn order to have the ability of warnings, which returned in the extensions of the response, you will need to supply them to\npolaris. you can supply the warnings through the context. let's see an example:\n\n```\nallBooksWithWarnings: async (\n    parent: any,\n    args: any,\n    context: PolarisGraphQLContext,\n): Promise\u003cBook[]\u003e =\u003e {\n    const connection = getPolarisConnectionManager().get();\n    context.returnedExtensions.warnings = ['warning 1', 'warning 2'];\n    return connection.getRepository(Book).find(context, { relations: ['author'] });\n}\n```\n\nAnd let's see an example of response with the warnings:\n\n```json\n{\n    \"data\": {\n        \"allBooks\": [\n            {\n                \"id\": \"53afd7e5-bf59-4408-acbc-1c5ebb5ff146\",\n                \"title\": \"Book1\",\n                \"author\": {\n                    \"firstName\": \"Author1\",\n                    \"lastName\": \"First\"\n                }\n            },\n            {\n                \"id\": \"4fab24e4-f584-4077-bb93-09cdfc88b202\",\n                \"title\": \"Book2\",\n                \"author\": {\n                    \"firstName\": \"Author2\",\n                    \"lastName\": \"Two\"\n                }\n            }\n        ]\n    },\n    \"extensions\": {\n        \"globalDataVersion\": 2,\n        \"warnings\": [\"warning 1\", \"warning 2\"]\n    }\n}\n```\n\nYou can see inside the `extensions` that we have the warnings we defined earlier.\n\n### Example\n\n```typescript\nimport { ApplicationProperties, PolarisServer } from '@enigmatis/polaris-core';\n\nconst typeDefs = `\n    type Query {\n        allPersons: [Person]\n    }\n\n    type Person implements RepositoryEntity {\n        id: String!\n        deleted: Boolean!\n        createdBy: String!\n        creationTime: DateTime!\n        lastUpdatedBy: String\n        lastUpdateTime: DateTime\n        realityId: Int!\n        name: String\n    }\n`;\nconst resolvers = {\n    Query: {\n        allPersons: () =\u003e [\n            { name: 'foo bar', realityId: 0, deleted: false, dataVersion: 2 },\n            { name: 'superman', realityId: 0, deleted: true, dataVersion: 3 },\n            { name: 'hello world', realityId: 1, deleted: true, dataVersion: 3 },\n            { name: 'something', realityId: 1, deleted: false, dataVersion: 4 },\n        ],\n    },\n};\nconst applicationProperties: ApplicationProperties = {\n    id: 'p0laris-c0re',\n    name: 'polaris-core',\n    version: 'v1',\n    environment: 'environment',\n    component: 'component',\n};\nconst server = new PolarisServer({\n    typeDefs,\n    resolvers,\n    port: 4000,\n    applicationProperties,\n});\nserver.start();\n```\n\nFor any additional help and requests, feel free to contact us :smile:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenigmatis%2Fpolaris-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenigmatis%2Fpolaris-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenigmatis%2Fpolaris-core/lists"}