{"repo":"mirego/absinthe_error_payload","free":true,"listed":false,"github":"https://github.com/mirego/absinthe_error_payload","clone":"git clone https://github.com/mirego/absinthe_error_payload.git","description":"Bridges the gap between Ecto and Absinthe for mutation payload","language":"Elixir","stars":116,"topics":["ecto","absinthe","graphql","elixir"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"Bridges the gap between Ecto and Absinthe GraphQL by listing validation messages in a mutation payload. The primary philosophy is that messages generated by invalid and/or unexpected user input are DATA, and should be returned as such. On 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. GraphQL fits perfectly here. Error are handled explicitly in the query and actual errors are treated as internal error on client side library. Installation Install by adding absinthe error payload to your list of dependencies in mix.exs : Usage The best place to find usage examples is by looking at the test cases at the AbsintheErrorPayload GitHub or the docs for AbsintheErrorPayload.Payload Here’s a quick summary of what AbsintheErrorPayload includes AbsintheErrorPayload.ValidationMessage structs/objects are created with all the information you’d normally be able to access through Ecto.Changeset.traverse errors/2. AbsintheErrorPayload includes a schema definition to add ValidationMessages to your schema. AbsintheErrorPayload.Payload 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). Payloads have three fields - successful - Indicates if the mutation completed successfully or not. Boolean. - messages - a list of validation errors. Always empty on success - result - the data ob","default_branch":null,"files":null,"tree":[],"storefront":"/r/mirego","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mirego/absinthe_error_payload/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}