strawberry
strawberry copied to clipboard
Schema visibility filters
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.
API
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?
Considerations
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)
Help us
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 😊
Related #361 #3274 #2609
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.