Hi in every rule in the documentation there is one part that is not clear why it’s there and what it does.
Can you explain it, please?
The part that is unclear is the one I between **:
You have pasted an example of an Auth rule on a type which applies a filter on the user. Now to find out whether any nodes passed the auth rule, you need to request some child field for the user. We would ultimately check if any Todos were returned from the auth rule and use that as the result of the query.
The field could be __typename or id as both the fields are always there for any object of a type, hence we use both of them interchangeably.
No, you still need the id in this query. A GraphQL query would only return the fields that are requested in it and not more.
You request for id or __typename in your Auth rule so that it returns some result. Think of it like this, we AND the result of your GraphQL query with the Auth rule to get the starting set of uids. So if either your GraphQL query or your Auth query didn’t return anything, the result would be empty.