Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema visibility filters #3343

Open
patrick91 opened this issue Jan 16, 2024 · 0 comments
Open

Schema visibility filters #3343

patrick91 opened this issue Jan 16, 2024 · 0 comments

Comments

@patrick91
Copy link
Member

patrick91 commented Jan 16, 2024

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.
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant