DEV Community

Discussion on: Five reasons you should consider AppSync over API Gateway

Collapse
 
hamishwhc profile image
HamishWHC

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?

Collapse
 
theburningmonk profile image
Yan Cui

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.