Skip to content

Conversation

bhunjadi
Copy link
Contributor

@bhunjadi bhunjadi commented Oct 25, 2023

What are we trying to solve with this PR?

For each named query, you should specify a body server-side in createNamedQuery function and these are the fields that can be fetched. Additional fields requested from the client will be ignored.
Additionally, you can also use embody to further limit the fields sent to a particular user.

But what if you want to send limited fields for users depending on a value inside a document? This PR focuses on that with subscriptionFilter option where you can access the document in a subscription and change it (remove fields or similar) on the fly before it is sent to the client(s).

Works with scoped queries.

Please see tests for better understanding.

@StorytellerCZ
Copy link
Collaborator

Can you please update the docs as well with this?

@bhunjadi
Copy link
Contributor Author

Docs updated

@bhunjadi
Copy link
Contributor Author

@StorytellerCZ Any ideas what happened with 2.3.1 tests? I tried with the same version locally, it's running fine.

@StorytellerCZ
Copy link
Collaborator

Looks like an issue in the test setup...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants