99designs / 99designs/gqlgen

Allow checking if Response Context exists

Đang mở
#3,388 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

### What happened?
The `panic` approach to treat cases when a Gqlgen related context is missing can cause unexpected issues when you have some helper func depending on one of the contexts to do something.

i.e. in our case, we have some helper functions that use the `AddError` and `GetErrors` but have no way to check if `HasResponseContext` similar to how we check if `HasOperationContext` based on the current API.

### What did you expect?

Have a function `HasResponseContext` to be able to check if it exists and prevent `panic` if it does not in code using gqlgen funcs that require the Response Context to exist.

### Minimal graphql.schema and models to reproduce

N/A

### versions
- the main branch still does not have a way to check if `Response Context` exists.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.