ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
4.96k stars 722 forks source link

Allow [Error] also for queries #7077

Closed cmeeren closed 3 weeks ago

cmeeren commented 3 weeks ago

Product

Hot Chocolate

Is your feature request related to a problem?

I know how to use [Error(...)] for mutations. It's great! However, I find myself needing this for queries, too.

For example, for a query with a phone number parameter, such an error could be returned for an invalid phone number. Or if a user is not allowed to access a field deep in a graph, a suitable authorization error could be returned from this field.

The solution you'd like

Support [Error] for queries, too.

tobias-tengler commented 3 weeks ago

That's already part of v14: https://youtu.be/yoW2Mt6C0Cg?si=ccXgU2oUX5G-64pv