In your public/private profile example, how would you denote in the GraphQL schema which is shown? Would a query to 'me' show the private one and a query to 'user(id:123)' show the public one? What if the user queries themselves with the second one? Does it still exclude the data?
yes, pretty much, for example, getMyProfile would return your Profile (the private one), but getUserProfile(userId: ID!) would return another user's PublicProfile. Even though both are coming from the same row in the DynamoDB, the fact that some fields are not on the schema means the extra data is excluded and not returned in the result.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In your public/private profile example, how would you denote in the GraphQL schema which is shown? Would a query to 'me' show the private one and a query to 'user(id:123)' show the public one? What if the user queries themselves with the second one? Does it still exclude the data?
yes, pretty much, for example,
getMyProfile
would return yourProfile
(the private one), butgetUserProfile(userId: ID!)
would return another user'sPublicProfile
. Even though both are coming from the same row in the DynamoDB, the fact that some fields are not on the schema means the extra data is excluded and not returned in the result.