absinthe-graphql / absinthe_plug

Plug support for Absinthe, the GraphQL toolkit for Elixir
https://hex.pm/packages/absinthe_plug
MIT License
260 stars 163 forks source link

Feat/add spec compliant errors opt #285

Open thecynicalpaul opened 1 year ago

thecynicalpaul commented 1 year ago

As per the spec (https://spec.graphql.org/October2021/#sec-Errors.Error-result-format) enables placing extra errors in the extensions field using spec_compliant_errors: bool plug option.

In line with https://github.com/absinthe-graphql/absinthe/pull/1215, this is an optional prop with a default of false until there is a major version release.

Fixes: #284

benwilson512 commented 1 year ago

Hey @thecynicalpaul I think this is a good contribution, but I am wondering if there is a more generic way to handle this so that it doesn't need to be managed this way with a custom pipeline. This limits the ease of use of this feature.

thecynicalpaul commented 1 year ago

Hey @thecynicalpaul I think this is a good contribution, but I am wondering if there is a more generic way to handle this so that it doesn't need to be managed this way with a custom pipeline. This limits the ease of use of this feature.

@benwilson512 Thanks! I am not 100% sure. I think it really depends on what is going to happen to Absinthe core. Right now, the spec_compliant_errors option is only supplied to the result phase. There isn't a simple way to use this for the end-user at the moment. Do you have any thoughts?

kradydal commented 11 months ago

Are you planning to merge it? It would be great to have this option in the absinthe_plug 🙏

maartenvanvliet commented 11 months ago

A PR to the absinthe core document pipeline where the options are passed through is first needed. Then the option can be added to absinthe_plug as well.

benwilson512 commented 9 months ago

Hey folks! I'm trying to follow up on the status of some of these PRs. Did the PR mentioned by @maartenvanvliet get submitted and merged?