Added support for maxDepth when fetching