dataconnect namespace

Functions

Function Description
initGraphqlServer(opts)
onGraphRequest(opts) Handles HTTPS GraphQL requests.
onMutationExecuted(mutation, handler) Event handler that triggers when a mutation is executed in Firebase Data Connect.
onMutationExecuted(opts, handler) Event handler that triggers when a mutation is executed in Firebase Data Connect.

Interfaces

Interface Description
DataConnectEvent
FirebaseContext Per-request context state shared by all resolvers in a particular query.
GraphqlError
GraphqlErrorExtensions
GraphqlResolvers Resolver functions that populate data for individual GraphQL schema fields.
GraphqlServerOptions Options for configuring the GraphQL server.
MutationEventData
OperationOptions OperationOptions extend EventHandlerOptions with a provided service, connector, and operation.
RawDataConnectEvent
RawMutation
SourceLocation

Type Aliases

Type Alias Description
AuthType AuthType defines the possible values for the authType field in a Firebase Data Connect event. - app_user: an end user of an application.. - admin: an admin user of an application. In the context of impersonate endpoints used by the admin SDK, the impersonator. - unknown: a general type to capture all other principals not captured in the other auth types.
DataConnectParams

dataconnect.initGraphqlServer()

Signature:

export declare function initGraphqlServer(opts: GraphqlServerOptions): Promise<express.Express>;

Parameters

Parameter Type Description
opts GraphqlServerOptions

Returns:

Promise<express.Express>

dataconnect.onGraphRequest()

Handles HTTPS GraphQL requests.

Signature:

export declare function onGraphRequest(opts: GraphqlServerOptions): HttpsFunction;

Parameters

Parameter Type Description
opts GraphqlServerOptions Options for configuring the GraphQL server.

Returns:

HttpsFunction

{HttpsFunction} A function you can export and deploy.

dataconnect.onMutationExecuted()

Event handler that triggers when a mutation is executed in Firebase Data Connect.

Signature:

export declare function onMutationExecuted<Mutation extends string, Variables = unknown, ResponseData = unknown>(mutation: Mutation, handler: (event: DataConnectEvent<MutationEventData<Variables, ResponseData>, DataConnectParams<Mutation>>) => unknown | Promise<unknown>): CloudFunction<DataConnectEvent<MutationEventData<Variables, ResponseData>, DataConnectParams<Mutation>>>;

Parameters

Parameter Type Description
mutation Mutation The mutation path to trigger on.
handler (event: DataConnectEvent<MutationEventData<Variables, ResponseData>, DataConnectParams<Mutation>>) => unknown | Promise<unknown> Event handler which is run every time a mutation is executed.

Returns:

CloudFunction<DataConnectEvent<MutationEventData<Variables, ResponseData>, DataConnectParams<Mutation>>>

dataconnect.onMutationExecuted()

Event handler that triggers when a mutation is executed in Firebase Data Connect.

Signature:

export declare function onMutationExecuted<Options extends OperationOptions, Variables = unknown, ResponseData = unknown>(opts: Options, handler: (event: DataConnectEvent<MutationEventData<Variables, ResponseData>, DataConnectParams<Options>>) => unknown | Promise<unknown>): CloudFunction<DataConnectEvent<MutationEventData<Variables, ResponseData>, DataConnectParams<Options>>>;

Parameters

Parameter Type Description
opts Options Options that can be set on an individual event-handling function.
handler (event: DataConnectEvent<MutationEventData<Variables, ResponseData>, DataConnectParams<Options>>) => unknown | Promise<unknown> Event handler which is run every time a mutation is executed.

Returns:

CloudFunction<DataConnectEvent<MutationEventData<Variables, ResponseData>, DataConnectParams<Options>>>

dataconnect.AuthType

AuthType defines the possible values for the authType field in a Firebase Data Connect event. - app_user: an end user of an application.. - admin: an admin user of an application. In the context of impersonate endpoints used by the admin SDK, the impersonator. - unknown: a general type to capture all other principals not captured in the other auth types.

Signature:

export type AuthType = "app_user" | "admin" | "unknown";

dataconnect.DataConnectParams

Signature:

export type DataConnectParams<PathPatternOrOptions extends string | OperationOptions> = PathPatternOrOptions extends string ? ParamsOf<PathPatternOrOptions> : PathPatternOrOptions extends OperationOptions<infer Service extends string, infer Connector extends string, infer Operation extends string> ? Record<VarName<Service> | VarName<Connector> | VarName<Operation>, string> : never;