firebase_functions.dataconnect_fn module
Stay organized with collections
Save and categorize content based on your preferences.
Module for Cloud Functions that are triggered by Firebase Data Connect.
Classes
Eventclass firebase_functions.dataconnect_fn.Event(specversion: str, id: str, source: str, type: str, time: datetime, data: T, subject: str | None, location: str, project: str, params: dict[str, str], auth_type: Literal['app_user', 'admin', 'unknown'], auth_id: str) |
|---|
|
Bases: CloudEvent[T]
A CloudEvent that contains MutationEventData.
-
auth_id: str
The unique identifier for the principal.
-
auth_type: Literal['app_user', 'admin', 'unknown']
The type of principal that triggered the event.
-
location: str
The location of the database.
-
params: dict[str, str]
A dict containing the values of the path patterns.
Only named capture groups are populated - {key}, {key=*}, {key=**}
-
project: str
The project identifier.
|
GraphQLErrorclass firebase_functions.dataconnect_fn.GraphQLError(message: str, locations: list[dict[str, int]] | None = None, path: list[str | int] | None = None, extensions: GraphqlErrorExtensions | None = None) |
|---|
|
Bases: object
An error that occurred during the execution of a GraphQL request.
-
extensions: GraphqlErrorExtensions | None = None
-
locations: list[dict[str, int]] | None = None
The source locations where the error occurred.
Locations should help developers and toolings identify the source of error
quickly.
Included in admin endpoints (ExecuteGraphql, ExecuteGraphqlRead,
UpdateSchema and UpdateConnector) to reference the provided GraphQL
GQL document.
Omitted in ExecuteMutation and ExecuteQuery since the caller shouldn't
have access access the underlying GQL source.
-
message: str
A string describing the error.
-
path: list[str | int] | None = None
The result field which could not be populated due to error.
Clients can use path to identify whether a null result is intentional or
caused by a runtime error.
It should be a list of string or index from the root of GraphQL query
document.
|
GraphqlErrorExtensionsclass firebase_functions.dataconnect_fn.GraphqlErrorExtensions(file: str, code: str, debug_details: str) |
|---|
|
Bases: object
GraphqlErrorExtensions contains additional information of GraphqlError.
-
code: str
Maps to canonical gRPC codes.
If not specified, it represents Code.INTERNAL.
-
debug_details: str
More detailed error message to assist debugging.
It contains application business logic that are inappropriate to leak
publicly.
In the emulator, Data Connect API always includes it to assist local
development and debugging.
In the backend, ConnectorService always hides it.
GraphqlService without impersonation always include it.
GraphqlService with impersonation includes it only if explicitly opted-in
with include_debug_details in GraphqlRequestExtensions.
-
file: str
The source file name where the error occurred.
Included only for UpdateSchema and UpdateConnector, it corresponds
to File.path of the provided Source.
|
MutationEventDataclass firebase_functions.dataconnect_fn.MutationEventData(payload: Mutation) |
|---|
|
Bases: object
The data within all Mutation events.
-
payload: Mutation
|
SourceLocationclass firebase_functions.dataconnect_fn.SourceLocation(line: int, column: int) |
|---|
|
Bases: object
SourceLocation references a location in a GraphQL source.
-
column: int
Column number starting at 1.
-
line: int
Line number starting at 1.
|
Functions
on_mutation_executedfirebase_functions.dataconnect_fn.on_mutation_executed(**kwargs) → Callable[[Callable[[Event[MutationEventData]], None]], Callable[[Event[MutationEventData]], None]] |
|---|
|
Event handler that triggers when a mutation is executed in Firebase Data Connect.
Example:
@on_mutation_executed(
service = "service-id",
connector = "connector-id",
operation = "mutation-name"
)
def mutation_executed_handler(event: Event[MutationEventData]):
pass
- Parameters:
**kwargs (as firebase_functions.options.DataConnectOptions) -- DataConnect options.
- Return type:
typing.Callable
[ [ firebase_functions.dataconnect_fn.Event [
object ] ], None ]
A function that takes a DataConnect event and returns None.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-03-18 UTC.
[null,null,["Last updated 2026-03-18 UTC."],[],[]]