Fork me on GitHub
#graphql
<
2019-01-29
>
amar19:01:58

Hi. With Lacinia, is there a way to determine how many levels deep a given query will go. For example, in the following query the max depth is 3.

user (id: 1) {  # invokes an explicit resolver (depth 0)
  id
  location {    # does not invoke a resolver
    city
    country
  }
  repos {       # invokes an explicit resolver (depth 1)
    id
    name
    issues {    # invokes an explicit resolver (depth 2)
      id
      description
      reporter {  # invokes an explicit resolver (depth 3)
        name
      }
    }
    commits {   # invokes an explicit resolver (depth 2)
      sha
      comment
    }
  }
}

hlship19:01:27

https://lacinia.readthedocs.io/en/latest/resolve/selections.html identifies how to preview selections inside a resolver, which gives an idea about what sub-selections will take place.

amar20:01:49

thanks will check that out.