oak-graphql icon indicating copy to clipboard operation
oak-graphql copied to clipboard

Get requested fields in resolver

Open EriKWDev opened this issue 4 years ago • 0 comments

Hi! Very nice module so far :)

I was wondering while trying to optimize my resolvers if there is a way to get the requested fields inside the resolver for a specific query?

For example, if the query is

{
   movies {
      title,
      tags {
          name
      }
   }
}

Is there a way to, in the resolver, get that the 'title' and 'tags' fields are the only requested ones?

Resolving 'tags' (or other certain fields) take longer than others, so it would be nice if I only had to resolve these if they are present in the query.

EriKWDev avatar Jul 03 '21 14:07 EriKWDev