Server#
This module contains helper functions and classes for working with the GraphQL server for Raphtory. Calling the run_server function will start the GraphQL server. If run in the background, this will return a GraphQLServer object that can be used to run queries.
Classes:
|
A helper class that can be used to query the Raphtory GraphQL server. |
Functions:
|
Runs the Raphtory GraphQL server. |
- class raphtory.graphqlserver.GraphQLServer(port)[source]#
Bases:
object
A helper class that can be used to query the Raphtory GraphQL server.
Methods:
query
(query)Runs a GraphQL query on the server.
Waits for the server to be online.
- raphtory.graphqlserver.run_server(graphs=None, graph_dir=None, port=1736, daemon=False)[source]#
Runs the Raphtory GraphQL server.
- Parameters:
graphs (dict, optional) – A dictionary of graphs to load into the server. Default is None.
graph_dir (str, optional) – The directory to load graphs from. Default is None.
port (int, optional) – The port to run the server on. Default is 1736.
daemon (bool, optional) – Whether to run the server in the background. Default is False.
- Returns:
A GraphQLServer object that can be used to query the server. (Only if daemon is True)
- Return type: