def patch(self, before: Union[(dict, List[dict], 'WOQLSchema', 'DocumentTemplate', List['DocumentTemplate'])], patch: Patch):
    'Apply the patch object to the before object and return an after object. Note that this change does not commit changes to the graph.\n\n        Do not connect when using public API.\n\n        Returns\n        -------\n        dict\n            After object\n\n        Examples\n        --------\n        >>> client = WOQLClient("https://127.0.0.1:6363/")\n        >>> client.connect(user="admin", key="root", team="admin", db="some_db")\n        >>> patch_obj = Patch(json=\'{"name" : { "@op" : "ValueSwap", "@before" : "Jane", "@after": "Janine" }}\')\n        >>> result = client.patch({ "@id" : "Person/Jane", "@type" : Person", "name" : "Jane"}, patch_obj)\n        >>> print(result)\n        \'{ "@id" : "Person/Jane", "@type" : Person", "name" : "Janine"}\''
    request_dict = {'before': self._convert_diff_dcoument(before), 'patch': patch.content}
    if self._connected:
        result = _finish_response(requests.post(self._patch_url(), headers={'user-agent': f'terminusdb-client-python/{__version__}'}, json=request_dict, auth=self._auth()))
    else:
        result = _finish_response(requests.post(self.server_url, headers={'user-agent': f'terminusdb-client-python/{__version__}'}, json=request_dict))
    return json.loads(result)
Apply the patch object to the before object and return an after object. Note that this change does not commit changes to the graph.

Do not connect when using public API.

Returns
-------
dict
    After object

Examples
--------
>>> client = WOQLClient("https://127.0.0.1:6363/")
>>> client.connect(user="admin", key="root", team="admin", db="some_db")
>>> patch_obj = Patch(json='{"name" : { "@op" : "ValueSwap", "@before" : "Jane", "@after": "Janine" }}')
>>> result = client.patch({ "@id" : "Person/Jane", "@type" : Person", "name" : "Jane"}, patch_obj)
>>> print(result)
'{ "@id" : "Person/Jane", "@type" : Person", "name" : "Janine"}'
def patch(self, before: Union[(dict, List[dict], 'WOQLSchema', 'DocumentTemplate', List['DocumentTemplate'])], patch: Patch):
    'Apply the patch object to the before object and return an after object. Note that this change does not commit changes to the graph.\n\n        Do not connect when using public API.\n\n        Returns\n        -------\n        dict\n            After object\n\n        Examples\n        --------\n        >>> client = WOQLClient("https://127.0.0.1:6363/")\n        >>> client.connect(user="admin", key="root", team="admin", db="some_db")\n        >>> patch_obj = Patch(json=\'{"name" : { "@op" : "ValueSwap", "@before" : "Jane", "@after": "Janine" }}\')\n        >>> result = client.patch({ "@id" : "Person/Jane", "@type" : Person", "name" : "Jane"}, patch_obj)\n        >>> print(result)\n        \'{ "@id" : "Person/Jane", "@type" : Person", "name" : "Janine"}\
    request_dict = {'before': self._convert_diff_dcoument(before), 'patch': patch.content}
    if self._connected:
        result = _finish_response(requests.post(self._patch_url(), headers={'user-agent': f'terminusdb-client-python/{__version__}'}, json=request_dict, auth=self._auth()))
    else:
        result = _finish_response(requests.post(self.server_url, headers={'user-agent': f'terminusdb-client-python/{__version__}'}, json=request_dict))
    return json.loads(result)