Skip to content

Commit 69ec94c

Browse files
yoshi-code-botcopybara-github
authored andcommitted
Add Firebase Data Connect mutation event definitions.
PiperOrigin-RevId: 788216494
1 parent 3c18e62 commit 69ec94c

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

proto/google/events/firebase/dataconnect/v1/data.proto

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ syntax = "proto3";
1616

1717
package google.events.firebase.dataconnect.v1;
1818

19+
import "google/protobuf/struct.proto";
1920
import "google/protobuf/timestamp.proto";
21+
import "google/rpc/code.proto";
2022

2123
option csharp_namespace = "Google.Events.Protobuf.Firebase.DataConnect.V1";
2224
option php_namespace = "Google\\Events\\Firebase\\DataConnect\\V1";
@@ -267,3 +269,92 @@ message ConnectorEventData {
267269
// Optional. The Connector event payload. Unset for deletion events.
268270
Connector payload = 1;
269271
}
272+
273+
// GraphqlError contains the error information of a GraphQL query or mutation.
274+
message GraphqlError {
275+
// The detailed error message.
276+
// The message should help developer understand the underlying problem without
277+
// leaking internal data.
278+
string message = 1;
279+
280+
// The source locations where the error occurred.
281+
// Locations should help developers and toolings identify the source of error
282+
// quickly.
283+
//
284+
// Included in admin endpoints (`ExecuteGraphql`, `ExecuteGraphqlRead`,
285+
// `UpdateSchema` and `UpdateConnector`) to reference the provided GraphQL
286+
// GQL document.
287+
//
288+
// Omitted in `ExecuteMutation` and `ExecuteQuery` since the caller shouldn't
289+
// have access access the underlying GQL source.
290+
repeated SourceLocation locations = 2;
291+
292+
// The result field which could not be populated due to error.
293+
//
294+
// Clients can use path to identify whether a null result is intentional or
295+
// caused by a runtime error.
296+
// It should be a list of string or index from the root of GraphQL query
297+
// document.
298+
google.protobuf.ListValue path = 3;
299+
300+
// Additional error information.
301+
GraphqlErrorExtensions extensions = 4;
302+
}
303+
304+
// GraphqlErrorExtensions contains additional information of `GraphqlError`.
305+
message GraphqlErrorExtensions {
306+
// The source file name where the error occurred.
307+
// Included only for `UpdateSchema` and `UpdateConnector`, it corresponds
308+
// to `File.path` of the provided `Source`.
309+
string file = 1;
310+
311+
// Maps to canonical gRPC codes.
312+
// If not specified, it represents `Code.INTERNAL`.
313+
google.rpc.Code code = 2;
314+
315+
// More detailed error message to assist debugging.
316+
// It contains application business logic that are inappropriate to leak
317+
// publicly.
318+
//
319+
// In the emulator, Data Connect API always includes it to assist local
320+
// development and debugging.
321+
// In the backend, ConnectorService always hides it.
322+
// GraphqlService without impersonation always include it.
323+
// GraphqlService with impersonation includes it only if explicitly opted-in
324+
// with `include_debug_details` in `GraphqlRequestExtensions`.
325+
string debug_details = 3;
326+
}
327+
328+
// SourceLocation references a location in a GraphQL source.
329+
message SourceLocation {
330+
// Line number starting at 1.
331+
int32 line = 1;
332+
333+
// Column number starting at 1.
334+
int32 column = 2;
335+
}
336+
337+
message Mutation {
338+
// The result of the execution of the requested operation.
339+
// If an error was raised before execution begins, the data entry should not
340+
// be present in the result. (a request error:
341+
// https://spec.graphql.org/draft/#sec-Errors.Request-Errors) If an error was
342+
// raised during the execution that prevented a valid response, the data entry
343+
// in the response should be null. (a field error:
344+
// https://spec.graphql.org/draft/#sec-Errors.Error-Result-Format)
345+
google.protobuf.Struct data = 1;
346+
347+
// Values for GraphQL variables provided in this request.
348+
google.protobuf.Struct variables = 2;
349+
350+
// Errors of this response.
351+
// If the data entry in the response is not present, the errors entry must be
352+
// present.
353+
// It conforms to https://spec.graphql.org/draft/#sec-Errors.
354+
repeated GraphqlError errors = 3;
355+
}
356+
357+
// The data within all Mutation events.
358+
message MutationEventData {
359+
Mutation payload = 1;
360+
}

proto/google/events/firebase/dataconnect/v1/events.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,15 @@ message ConnectorDeletedEvent {
131131
// The data associated with the event.
132132
ConnectorEventData data = 1;
133133
}
134+
135+
// The CloudEvent raised when a Mutation is executed.
136+
message MutationExecutedEvent {
137+
option (google.events.cloud_event_type) =
138+
"google.firebase.dataconnect.connector.v1.mutationExecuted";
139+
option (google.events.cloud_event_extension_name) = "connector";
140+
option (google.events.cloud_event_extension_name) = "service";
141+
option (google.events.cloud_event_extension_name) = "operation";
142+
143+
// The data associated with the event.
144+
MutationEventData data = 1;
145+
}

0 commit comments

Comments
 (0)