I have a GraphQL schema is a paired down model for the data requested by the client to the server. The server uses a resolver which in turn calls a datasource. The data source calls into a SQL server and gets all the fields of the db. It passes all the fields back to the resolver. Somewhere after the resolver, that model is paired down in the GraphQL schema for the client.
I’m looking for where I can see that transition, if possible from the larger model from the DB to the smaller model for GraphQL. It doesn’t appear to be something in the code but perhaps somewhere inside Apollo itself?
It’s going to be hard to track that down without being able to see what’s going on your end. We have a Discord Server that you could join and I would be happy to jump on a live stream with you to help out!
It is pretty common to keep your resolvers light and have them call out to a single function that does any data transformation. GraphQL by default will only return to the client what is requested, but the resolvers can have access to more fields that what the schema actually dictates (GraphQL will cut it down).
I suspect it’s the GraphQL portion that is what you’re seeing.
For example, this JSON object for a User:
{
"name": "Michael",
"wontShow": true
}
being returned in a resolver where the schema is:
type User {
name: String
email: String
...
}
the wontShow field will never be returned to the client and they won’t be able to query it.