thecodingmachine / graphqlite

Use PHP Attributes/Annotations to declare your GraphQL API
https://graphqlite.thecodingmachine.io
MIT License
554 stars 95 forks source link

[Error handling] Category missing in error response #683

Closed cvergne closed 2 months ago

cvergne commented 3 months ago

Hi,

Since the update to webonyx/graphql-php v15, the category property is missing from extensions node in response.

The lib has removed the category node ( see upgrade guide v14 -> v15), which means documentation shows wrong examples and Exceptions in Graphqlite library still have the category getter/setter.

What should be done about that ? Manually adding back the category in WebonyxErrorHandler or totally removing it everywhere ?

oojacoboo commented 3 months ago

These categories never made much sense to me. I don't understand how GraphQLite could, or why it should, attempt to categorize errors on behalf of an application/API. The organization of that API is going to have it's own, unique, requirements. We've never used this value in the error output. I see no reason to maintain it and don't see why, if it's needed, it cannot be re-implemented.

My vote is for removal and cleanup. I'm open to hear other opinions on it.

cvergne commented 3 months ago

I've noticed it because, on a project I'm working on, we are using it, but I can confirm it's pretty easy to handle it again outside of the library.

So from the point of view of the graphqlite library, I agree with you, we should remove any occurrence of "category".

I could do the PR ;)

oojacoboo commented 3 months ago

Being that there hasn't been any pushback on this, let's go forward with removing in a PR. Please include details in the PR description on the BC breaks and suggested fixes. Thanks!