INNER CODE UNIT · Python
get_path_from_root
gsmith257-cyber/GraphCrawler · clairvoyance/graphql.py:102
def get_path_from_root(self, name: str) -> List[str]:
logging.debug(f"Entered get_path_from_root({name})")
path_from_root = []
if name not in self.types:
raise Exception(f"Type '{name}' not in schema!")
roots = [
self._schema["queryType"]["name"] if self._schema["queryType"] else "",
self._schema["mutationType"]["name"]
if self._schema["mutationType"]
else "",
self._schema["subscriptionType"]["name"]
if self._schema["subscriptionType"]
else "",
]
roots = [r for r in roots if r]