graphql-python / graphql-python/flask-graphql

Best way to authenticate requests

Đang mở
#17 7 bình luận 5 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
1.3k
Fork
139
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I am trying to figure out the best way to authenticate a request before my schema executes the query/mutation. I was thinking I could use the @app.resolver('url') tag and create a function that would authenticate the request and then pass it to the graphqlview. Something like this:
```
@app.route('/graphql/')
def graphql():
print request.headers #AUTHENTICATE HERE
print request.data
return GraphQLView.as_view('/graphql/', schema=schema, graphiql=True)
```
But this doesn't work, can someone either show me what I am doing wrong here or give me a different way to authenticate the request? Thanks!

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đá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.