GenCaster Base#
In this module we will find all things concerning connection and.
As it is difficult to split GraphQL endpoints across apps we also define them here as reusability of the apps is probably not a concern for now and is more used to split different parts for testing purposes.
Schema#
Here we define all the endpoints for GraphQL.
For a specific details of the types consider the GraphiQL page available under the /graphql endpoint of the running backend.
Any subscription updates are messaged via Redis and
is handled via channels and has an abstraction layer
GenCasterChannel
.
- class gencaster.schema.AuthStrawberryDjangoField(*args, only=None, select_related=None, prefetch_related=None, disable_optimization=False, **kwargs)[source]#
Allows us to restrict certain actions to logged in users.
- class gencaster.schema.Mutation[source]#
Mutations for Gencaster via GraphQL.
- __init__()#
- async add_edge(info, new_edge)[source]#
Creates a
Edge
for a givenGraph
. It returns the created edge.- Return type:
Edge
- async add_node(info, new_node)[source]#
Creates a new
Node
in a given ~class:~story_graph.models.Graph. Although it creates a new node with UUID we don’t hand it back yet.- Return type:
- async create_script_cells(info, script_cell_inputs, node_uuid)[source]#
Creates or updates a given
ScriptCell
to change its content.- Return type:
List
[ScriptCell
]
- async delete_node_door(info, node_door_uuid)[source]#
Allows to delete a non-default NodeDoor. If a node door was deleted it will return
True
, otherwiseFalse
.- Return type:
- async delete_script_cell(info, script_cell_uuid)[source]#
Deletes a given
ScriptCell
.- Return type:
- class gencaster.schema.Query(*, stream_point, stream_points, graphs, graph, nodes, node, audio_files, audio_file, stream_variable)[source]#
Queries for Gencaster.
- __init__(*, stream_point, stream_points, graphs, graph, nodes, node, audio_files, audio_file, stream_variable)#
- class gencaster.schema.Subscription[source]#
- __init__()#
- async graph(info, graph_uuid)[source]#
Used within the editor to synchronize any updates of the graph such as movement of a
Node
.- Return type:
AsyncGenerator
[Graph
,None
]
- async node(info, node_uuid)[source]#
Used within the editor to synchronize any updates on a node such as updates on a
ScriptCell
.- Return type:
AsyncGenerator
[Node
,None
]
- async stream_info(info, graph_uuid)[source]#
Used within the frontend to attach a user to a stream.
Engine
contains the specifics of how the iteration over a graph is handled.Upon visit the
num_of_listeners
of the associated :class:~stream.models.Stream` will be incremented which indicates if a given stream is free or used. Upon connection stop this will be decremented again.- Return type:
AsyncGenerator
[StrawberryUnion
,None
]
- class gencaster.schema.User(*, username, is_staff, is_active, first_name, last_name, email)[source]#
- __init__(*, username, is_staff, is_active, first_name, last_name, email)#
- async gencaster.schema.graphql_check_authenticated(info)[source]#
Helper function to determine if we are loggin in an async manner.
This would be better a decorator but strawberry is not nice in these regards, see Stack Overflow.
Distributor#
A collection of async messaging tools which is used by our GraphQL schema.
- class gencaster.distributor.GenCasterChannel[source]#
Abstraction layer for channels.
Publish and subscribe to specific updates or more general ones as well.
- class gencaster.distributor.GraphQLWSConsumerInjector(*args, **kwargs)[source]#
Allows us to inject callbacks on e.g. a disconnect.
Todo
This can be made obsolete via strawberry-graphql/strawberry#2430
- class gencaster.distributor.GraphUpdateMessage(uuid, type='graph.update', additional_channels=<factory>)[source]#
- __init__(uuid, type='graph.update', additional_channels=<factory>)#
- class gencaster.distributor.NodeUpdateMessage(uuid, type='node.update', additional_channels=<factory>)[source]#
- __init__(uuid, type='node.update', additional_channels=<factory>)#
- class gencaster.distributor.StreamLogUpdateMessage(uuid, stream_point_uuid, stream_uuid, type='stream_log.update', additional_channels=<factory>)[source]#
- __init__(uuid, stream_point_uuid, stream_uuid, type='stream_log.update', additional_channels=<factory>)#
Settings#
Configure environment for Gencaster backend.
Base settings#
Configures plugins, database, logging and media assets configuration.
Test#
Settings to run tests in by using local sqlite database.
Development#
Development#
Configures settings to allow access from local node environments.
Local development#
Switch to local sqlite database.
Deployment#
Deploy Dev#
Settings for deploying “production” dev environment on the server via Docker.
ASGI config for gencaster project.