INNER CODE UNIT · Python
from_json
gsmith257-cyber/GraphCrawler · clairvoyance/graphql.py:227
def from_json(cls, jso: Dict[str, Any]) -> "InputValue":
name = jso["name"]
typ = field_or_arg_type_from_json(jso["type"])
return cls(name=name, typ=typ)
def field_or_arg_type_from_json(jso: Dict[str, Any]) -> "TypeRef":
typ = None
if jso["kind"] not in ["NON_NULL", "LIST"]:
typ = TypeRef(name=jso["name"], kind=jso["kind"])
elif not jso["ofType"]["ofType"]:
actual_type = jso["ofType"]
if jso["kind"] == "NON_NULL":
typ = TypeRef(
name=actual_type["name"],