{"id":21038342,"url":"https://github.com/qlaffont/unify-mercurius","last_synced_at":"2025-05-15T15:33:30.125Z","repository":{"id":40561433,"uuid":"484047726","full_name":"qlaffont/unify-mercurius","owner":"qlaffont","description":"Mercurius error formater with unify-errors","archived":false,"fork":false,"pushed_at":"2025-05-13T22:05:34.000Z","size":2029,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-14T00:07:00.213Z","etag":null,"topics":["fastify","graphql","mercurius","typescript","unify-errors"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/unify-mercurius","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/qlaffont.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-21T12:44:21.000Z","updated_at":"2025-05-13T22:04:54.000Z","dependencies_parsed_at":"2023-08-28T13:54:38.524Z","dependency_job_id":"c85ec893-7901-43b0-aae8-3e5149988bfe","html_url":"https://github.com/qlaffont/unify-mercurius","commit_stats":null,"previous_names":["qlaffont/unify-mercurius","flexper/unify-mercurius"],"tags_count":650,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlaffont%2Funify-mercurius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlaffont%2Funify-mercurius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlaffont%2Funify-mercurius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qlaffont%2Funify-mercurius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qlaffont","download_url":"https://codeload.github.com/qlaffont/unify-mercurius/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254367884,"owners_count":22059581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fastify","graphql","mercurius","typescript","unify-errors"],"created_at":"2024-11-19T13:31:24.675Z","updated_at":"2025-05-15T15:33:29.708Z","avatar_url":"https://github.com/qlaffont.png","language":"TypeScript","readme":"[![Test Coverage](https://api.codeclimate.com/v1/badges/d28d1f8e89ae26ed6055/test_coverage)](https://codeclimate.com/github/qlaffont/unify-mercurius/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d28d1f8e89ae26ed6055/maintainability)](https://codeclimate.com/github/qlaffont/unify-mercurius/maintainability)\n![npm](https://img.shields.io/npm/v/unify-mercurius) ![npm](https://img.shields.io/npm/dm/unify-mercurius) ![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/unify-mercurius) ![NPM](https://img.shields.io/npm/l/unify-mercurius)\n# Unify Mercurius\n\nA Mercurius plugin wrapping [unify-errors](https://github.com/qlaffont/unify-errors) to handle REST errors. Old Owner: [@flexper](https://github.com/flexper)\n\n## Install\n\n```sh\nnpm i unify-mercurius\n# Or\nyarn add unify-mercurius\n# Or\npnpm add unify-mercurius\n```\n\n## Use\n\n```javascript\n'use strict'\n\nconst Fastify = require('fastify')\nconst mercurius = require('mercurius')\nconst { unifyMercuriusErrorFormatter } = require('unify-mercurius')\n\nconst app = Fastify()\n\nconst schema = `\n  type Query {\n    add(x: Int, y: Int): Int\n  }\n`\n\nconst resolvers = {\n  Query: {\n    add: async (_, { x, y }) =\u003e x + y\n  }\n}\n\napp.register(mercurius, {\n  schema,\n  resolvers,\n  errorFormatter: unifyMercuriusErrorFormatter()\n})\n\napp.get('/', async function (req, reply) {\n  const query = '{ add(x: 2, y: 2) }'\n  return reply.graphql(query)\n})\n\napp.listen(3000)\n\n```\n\n## Plugin options\n\n| name             | default | description                                                       |\n| ---------------- | ------- | ----------------------------------------------------------------- |\n| _disableDetails_ | false   | If true will remove the originalError key from the error response |\n| _disableLog_     | false   | Disable logging on error                                          |\n\n## Tests\n\nTo execute jest tests (all errors, type integrity test)\n\n```bash\npnpm test\n```\n\n## Maintain\n\nThis package use [TSdx](https://github.com/jaredpalmer/tsdx). Please check documentation to update this package.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqlaffont%2Funify-mercurius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqlaffont%2Funify-mercurius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqlaffont%2Funify-mercurius/lists"}