Client#

Classes:

RaphtoryGraphQLClient(url)

A client for handling GraphQL operations in the context of Raphtory.

class raphtory.graphqlclient.RaphtoryGraphQLClient(url: str)[source]#

Bases: object

A client for handling GraphQL operations in the context of Raphtory.

Methods:

load_graphs_from_path(path)

Load graphs from a directory of bincode files.

load_new_graphs_from_path(path)

Load new graphs from a directory of bincode files.

query(query[, variables])

Execute a GraphQL query.

send_graph(name, graph)

Upload a graph to the GraphQL Server.

Parameters:

url (str) –

load_graphs_from_path(path: str) dict[source]#

Load graphs from a directory of bincode files.

Parameters:

path (str) – Directory containing bincode files.

Returns:

Result after executing the mutation.

Return type:

dict

Note

Existing graphs with the same name are overwritten.

load_new_graphs_from_path(path: str) dict[source]#

Load new graphs from a directory of bincode files.

Parameters:

path (str) – Directory containing bincode files.

Returns:

Result after executing the mutation.

Return type:

dict

Note

Existing graphs will not be overwritten.

query(query: str, variables: dict = {})[source]#

Execute a GraphQL query.

Parameters:
  • query (str) – The GraphQL query string.

  • variables (dict, optional) – Variables for the query. Defaults to an empty dictionary.

Returns:

Result of the query.

Return type:

dict

send_graph(name: str, graph: Graph)[source]#

Upload a graph to the GraphQL Server.

Parameters:
  • name (str) – Name of the graph.

  • graph (raphtory.Graph) – Graph object to be uploaded.

Returns:

Result after executing the mutation.

Return type:

dict

Raises:

Exception – If there’s an error sending the graph.