{"id":19106553,"url":"https://github.com/mirego/absinthe_error_payload","last_synced_at":"2025-04-07T17:07:21.823Z","repository":{"id":38272367,"uuid":"184159579","full_name":"mirego/absinthe_error_payload","owner":"mirego","description":"Bridges the gap between Ecto and Absinthe for mutation payload","archived":false,"fork":false,"pushed_at":"2024-09-23T17:12:54.000Z","size":103,"stargazers_count":115,"open_issues_count":14,"forks_count":26,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-03-31T16:13:48.414Z","etag":null,"topics":["absinthe","ecto","elixir","graphql"],"latest_commit_sha":null,"homepage":"https://open.mirego.com","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirego.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2019-04-29T23:43:21.000Z","updated_at":"2024-12-15T11:00:07.000Z","dependencies_parsed_at":"2024-06-18T22:51:37.996Z","dependency_job_id":"385c26c3-32a9-475d-abe4-e62f2d9f6e4e","html_url":"https://github.com/mirego/absinthe_error_payload","commit_stats":{"total_commits":75,"total_committers":16,"mean_commits":4.6875,"dds":0.6799999999999999,"last_synced_commit":"500335123ae65e2304ea7af2612214fad307314a"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fabsinthe_error_payload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fabsinthe_error_payload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fabsinthe_error_payload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirego%2Fabsinthe_error_payload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirego","download_url":"https://codeload.github.com/mirego/absinthe_error_payload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694875,"owners_count":20980733,"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":["absinthe","ecto","elixir","graphql"],"created_at":"2024-11-09T04:08:38.214Z","updated_at":"2025-04-07T17:07:21.757Z","avatar_url":"https://github.com/mirego.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/464900/56933576-702b7880-6ab6-11e9-8b09-d86de46d2edc.png\" width=\"600\" /\u003e\n  \u003cbr /\u003e\u003cbr /\u003e\n  Bridges the gap between \u003ca target=\"_blank\" href=\"https://hexdocs.pm/ecto/Ecto.html\"\u003eEcto\u003c/a\u003e and \u003ca target=\"_blank\" href=\"http://absinthe-graphql.org/\"\u003eAbsinthe GraphQL\u003c/a\u003e\u003cbr /\u003e by listing validation messages in a mutation payload.\n  \u003cbr /\u003e\u003cbr /\u003e\n  \u003ca href=\"https://github.com/mirego/absinthe_error_payload/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush\"\u003e\u003cimg src=\"https://github.com/mirego/absinthe_error_payload/workflows/CI/badge.svg?branch=master\u0026event=push\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/mirego/absinthe_error_payload?branch=master\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/mirego/absinthe_error_payload/badge.svg?branch=master\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://hex.pm/packages/absinthe_error_payload\"\u003e\u003cimg src=\"https://img.shields.io/hexpm/v/absinthe_error_payload.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThe primary philosophy is that messages generated by invalid and/or unexpected user input are DATA, and should be returned as such.\nOn the other hand, errors made in using an API - like querying a field that doesn’t exist -, are actually ERRORS and should be returned as errors.\n\nGraphQL fits perfectly here. Error are handled explicitly in the query and actual errors are treated as internal error on client side library.\n\n## Installation\n\nInstall by adding `absinthe_error_payload` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:absinthe_error_payload, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n## Usage\n\nThe best place to find usage examples is by looking at the test cases at the [AbsintheErrorPayload GitHub](https://github.com/mirego/absinthe_error_payload) or the docs for [AbsintheErrorPayload.Payload](https://hexdocs.pm/absinthe_error_payload/AbsintheErrorPayload.Payload.html#content)\n\nHere’s a quick summary of what AbsintheErrorPayload includes\n\n[AbsintheErrorPayload.ValidationMessage](https://hexdocs.pm/absinthe_error_payload/AbsintheErrorPayload.ValidationMessage.html#content) structs/objects are created with all the information you’d normally be able to access through [Ecto.Changeset.traverse_errors/2](https://hexdocs.pm/ecto/Ecto.Changeset.html#traverse_errors/2).\n\nAbsintheErrorPayload includes a [schema](https://hexdocs.pm/absinthe_error_payload/AbsintheErrorPayload.ValidationMessageTypes.html#content) definition to add ValidationMessages to your schema.\n\n[AbsintheErrorPayload.Payload](https://hexdocs.pm/absinthe_error_payload/AbsintheErrorPayload.Payload.html#content) is middleware that takes your resolver output (either an updated object or a changeset with errors) and converts it into a AbsintheErrorPayload Mutation Response (aka Payload).\n\nPayloads have three fields\n\n- `successful` - Indicates if the mutation completed successfully or not. Boolean.\n- `messages` - a list of validation errors. Always empty on success\n- `result` - the data object that was created/updated/deleted on success. Always nil when unsuccessful.\n\nFinally [AbsintheErrorPayload.TestHelper](https://hexdocs.pm/absinthe_error_payload/AbsintheErrorPayload.TestHelper.html#content) has some helper methods that make it easier to write ExUnit tests against your schema.\n\n## Hey, this looks like Kronky!\n\nThis library has been forked from [Kronky](https://github.com/Ethelo/kronky), renamed to `AbsintheErrorPayload` and published on `hexpm`.\nKronky was not being updated and while it still worked for older versions, a more maintained release was requested by many users.\n\nThank you [Ethelo](http://ethelo.com/) for the awesome library!\n\n## License\n\nAbsintheErrorPayload is © 2019 [Mirego](https://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](https://github.com/mirego/absinthe_error_payload/blob/master/LICENSE.md) file.\n\nAs mentioned above, AbsintheErrorPayload is based on [Kronky](https://github.com/Ethelo/kronky) which is licensed under the [MIT license](http://opensource.org/licenses/MIT). See the [`KRONKY_LICENSE.md`](https://github.com/mirego/absinthe_error_payload/blob/master/KRONKY_LICENSE.md) file.\n\nThe flask logo is based on [this lovely icon by Danil Polshin](https://thenounproject.com/term/flask/1428207), from The Noun Project. Used under a [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/) license.\n\n## About Mirego\n\n[Mirego](https://www.mirego.com) is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of [talented people](https://life.mirego.com) who imagine and build beautiful Web and mobile applications. We come together to share ideas and [change the world](http://www.mirego.org).\n\nWe also [love open-source software](https://open.mirego.com) and we try to give back to the community as much as we can.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirego%2Fabsinthe_error_payload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirego%2Fabsinthe_error_payload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirego%2Fabsinthe_error_payload/lists"}