INNER CODE UNIT · Python
Field
gsmith257-cyber/GraphCrawler · clairvoyance/graphql.py:283
class Field:
def __init__(self, name: str, typeref: TypeRef, args: List[InputValue] = None):
if not typeref:
raise Exception(f"Can't create {name} Field from {typeref} TypeRef.")
self.name = name
self.type = typeref
self.args = args or []
def to_json(self):
return {
"args": [a.to_json() for a in self.args],
"deprecationReason": None,
"description": None,
"isDeprecated": False,
"name": self.name,
"type": self.type.to_json(),
}