# How do I find which fields need to be resolved from \`info: GraphQLResolveInfo\`?

**URL:** https://community.apollographql.com/t/how-do-i-find-which-fields-need-to-be-resolved-from-info-graphqlresolveinfo/5703
**Category:** Server
**Tags:** server
**Created:** [February 13, 2023, 9:10am UTC](https://community.apollographql.com/t/how-do-i-find-which-fields-need-to-be-resolved-from-info-graphqlresolveinfo/5703 "2023-02-13T09:10:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Dulguun\_Otgon](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/dulguun_otgon/32/4069_2.png) [@Dulguun\_Otgon](https://community.apollographql.com/u/Dulguun_Otgon)
#### Post date: [February 13, 2023, 9:10am UTC](https://community.apollographql.com/t/how-do-i-find-which-fields-need-to-be-resolved-from-info-graphqlresolveinfo/5703/1 "2023-02-13T09:10:41Z")

</div>

Let’s say graphql type definitions is

```graphql
type Post {
    id: ID!
    tags: Tag
}

type Tag {
    id: ID!
    name
    parentTag: Tag
}

type Query {
    lastPost: Post
}

```

and the user query is

```graphql
{
   query {
       lastPost {
           tags {
               name
               parentTag {
                   name
               }
           }
       }
   }
}

```

and the `Query.lastPost` resolver will return

```json
{
   "id": 1,
   "tagIds": [5,6,7]
}

```

How do I extract what’s missing from inside the `Query.lastPost` and get the result below?

```javascript
const missingFields = `
           tags {
               name
               parentTag {
                   name
               }
           }
`;

```

---

<div class="post-metadata">

### Author: ![trevor.scheer](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/trevor.scheer/32/5669_2.png) [@trevor.scheer](https://community.apollographql.com/u/trevor.scheer)
#### Post date: [February 13, 2023, 7:32pm UTC](https://community.apollographql.com/t/how-do-i-find-which-fields-need-to-be-resolved-from-info-graphqlresolveinfo/5703/2 "2023-02-13T19:32:38Z")

</div>

Do you mind sharing why you’re trying to gather that information? My instinct is to steer you away from that question unless you have a very specific reason to do that.

A more conventional approach for your resolvers might look something like this. Note that `lastPost` doesn’t return tag IDs since it really shouldn’t be concerned with whether or not `tags` was requested or not. Now `tags` is responsible for loading all the tags that belong to a post.

Does this make sense? Is this what you’re looking to accomplish?

```plaintext
  resolvers: {
    Query: {
      lastPost() {
        return { id: 1 };
      },
    },
    Post: {
      tags(parentValue) {
        // const tagsForPost = lookup tags by parentValue.id (post ID)
        return [{id: 1, name: "tag1"}]
      }
    }
  },

```

Also there’s an error in your SDL, I assume you meant `tags: [Tag!]` (it’s currently not a list type in your snippet)

---

<div class="post-metadata">

### Author: ![Dulguun\_Otgon](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/dulguun_otgon/32/4069_2.png) [@Dulguun\_Otgon](https://community.apollographql.com/u/Dulguun_Otgon)
#### Post date: [March 20, 2023, 2:43pm UTC](https://community.apollographql.com/t/how-do-i-find-which-fields-need-to-be-resolved-from-info-graphqlresolveinfo/5703/3 "2023-03-20T14:43:36Z")

</div>

[GitHub - apollosolutions/federation-subscription-tools: A set of demonstration utilities to facilitate GraphQL subscription usage alongside a federated data graph](https://github.com/apollosolutions/federation-subscription-tools) already does that. I’m trying to what it does, without this library.

---

<div class="post-metadata">

### Author: ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)
#### Post date: [February 6, 2025, 8:49pm UTC](https://community.apollographql.com/t/how-do-i-find-which-fields-need-to-be-resolved-from-info-graphqlresolveinfo/5703/4 "2025-02-06T20:49:11Z")

</div>


