strawberry-graphql / strawberry

A GraphQL library for Python that leverages type annotations 🍓
https://strawberry.rocks
MIT License
3.92k stars 516 forks source link

Expose common request on extensions' context #3440

Open patrick91 opened 5 months ago

patrick91 commented 5 months ago

The Stellate extension for Strawberry needs some information from the request:

https://github.com/StellateHQ/stellate-strawberry/blob/9a2305789b1d9cd8c3ce8326e194635bb73fffbe/stellate_strawberry/__init__.py#L66-L82

but I'm not totally sure it will work with all integrations, so I was wondering if we could provide a request like object that has all these information, but with one unified API (we already have it in the http codebase, so it should be easy to do)

Upvote & Fund

Fund with Polar

DoctorJohn commented 2 months ago

Just to be sure, you're referring to the requests HTTP method and the requests HTTP headers, correct? Everything else seems to be take from the execution context, execution result, etc.

patrick91 commented 2 months ago

yup!