99designs / 99designs/gqlgen

Pass authentication through root resolver instead of middleware?

Đang mở
#1,415 4 bình luận 7 reaction 0 người được giao Xem trên GitHub
enhancement
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ả

Hi there,
Is is possible to pass authentication via `&graph.Resolver{}` instead of through context? Having Auth in middleware/context tightly couples it to the implementation (and requires all tests, etc to be blessed with the right context) As well, it would be nice to be able to use the graphql error presenter for eveything including auth, instead of bailing out early in middleware

To do this, I think I need to generate the schema per request, but I'm not sure of the performance penalty here

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.