I'm opening a new issue to spec-out the API, and also write down what should we take into account to make this happen.
Visibility filters will be a feature that allows to hide fields (or types) based on the current request. This is different from #3274 where we allow people to customise fields at schema build time.
This is to be defined, I just put a random though here for now:
@strawberry.type
class MyUser:
id: str
email: str = strawberry.field(...) # do we use tags? or do we go with functions?
This should be fast, we can't afford to do a lot of work at request time, which I guess means we can't build the schema at request time. @erikwrede @skilkis @bellini666 this could be a cool conversation to have π
Security, this should be secure, we should make sure we cover all the execution paths and make sure we never allow running resolvers when they should be hidden. Also we need to make sure we do the right thing when introspecting the schema and when printing the schema (where we won't have the request context)
If you want this feature, please let us know, I'm also happy to hop on calls, and please consider sponsoring us, especially if your company needs this, there's a badge at the bottom to sponsor this issue, but we also have GitHub sponsorship enabled π
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too