I’m trying out Apollo graphql federation. To optimize the query to the backend database, i am looking to get the selected fields from graphql query in resolvers. For example, in the below query, how can get the fields “name”, “missions.designation” in the resolver so that the select query will contain only these field rather than getting all the columns.
Appreciate if anyone can give some direction on this.
query Astronaut($astronautId: ID!) {
astronaut(id: $astronautId) {
name
missions {
designation
}
}
}