INNER CODE UNIT · Python

get_type_without_fields

gsmith257-cyber/GraphCrawler · clairvoyance/graphql.py:132

    def get_type_without_fields(self, ignore: Set[str] = []) -> str:
        for t in self.types.values():
            if not t.fields and t.name not in ignore and t.kind != "INPUT_OBJECT":
                return t.name

        return ""

    def convert_path_to_document(self, path: List[str]) -> str:
        logging.debug(f"Entered convert_path_to_document({path})")
        doc = "FUZZ"

        while len(path) > 1:
            doc = f"{path.pop()} {{ {doc} }}"

        if path[0] == self._schema["queryType"]["name"]:
            doc = f"query {{ {doc} }}"
        elif path[0] == self._schema["mutationType"]["name"]:
            doc = f"mutation {{ {doc} }}"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…