If I have the schema:
type Query {
posts: [Post!]!
}
type Post {
title: String!
lotsofdata: String
}
and a resolver:
function posts(parent, args, context, info) {
return readAllPosts(/*?*/)
}
And two possible queries. Query #1:
query {
posts{
title
}
}
and query #2:
query {
posts{
title
lotsofdata
}
}
Is it possible to optimise the resolver so with query #1 readAllPosts only pulls back titles from the database but for query #2 it pulls back both titles and lotsofdata?
I've looked at the parent, args, context, and info arguments but can't see anything to indicate whether the resolver is being called in response to a query like #1 or like #2.