diff --git a/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/input.gql b/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/input.gql index 7e88f7d7b3c6..c5c0cbc5f738 100755 --- a/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/input.gql +++ b/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/input.gql @@ -1,118 +1,424 @@ -scalar DirectedBy_Key -scalar Movie_Key -scalar Person_Key -scalar TimestampHolder_Key +""" +✨ DirectedBy_KeyOutput includes the primary key fields of DirectedBy +""" +scalar DirectedBy_KeyOutput +""" +✨ Movie_KeyOutput includes the primary key fields of Movie +""" +scalar Movie_KeyOutput +""" +✨ Person_KeyOutput includes the primary key fields of Person +""" +scalar Person_KeyOutput +""" +✨ TimestampHolder_KeyOutput includes the primary key fields of TimestampHolder +""" +scalar TimestampHolder_KeyOutput +""" +✨ Generated Data input type based on DirectedBy +""" input DirectedBy_Data { + """ + ✨ + """ movieId: UUID + """ + ✨ _expr server value of movieId + """ movieId_expr: UUID_Expr + """ + ✨ + """ directedbyId: UUID + """ + ✨ _expr server value of directedbyId + """ directedbyId_expr: UUID_Expr + """ + ✨ + """ directedby: Person_Key + """ + ✨ + """ movie: Movie_Key } +""" +✨ Generated Filter input type based on DirectedBy +""" input DirectedBy_Filter { _and: [DirectedBy_Filter!] _not: DirectedBy_Filter _or: [DirectedBy_Filter!] + """ + ✨ + """ movieId: UUID_Filter + """ + ✨ + """ directedbyId: UUID_Filter + """ + ✨ + """ directedby: Person_Filter + """ + ✨ + """ movie: Movie_Filter } +""" +✨ Generated Key input type based on DirectedBy +""" +input DirectedBy_Key { + """ + ✨ + """ + movieId: UUID + """ + ✨ _expr server value of movieId + """ + movieId_expr: UUID_Expr + """ + ✨ + """ + directedbyId: UUID + """ + ✨ _expr server value of directedbyId + """ + directedbyId_expr: UUID_Expr +} +""" +✨ Generated ListFilter input type based on DirectedBy +""" input DirectedBy_ListFilter { count: Int_Filter = {gt:0} exist: DirectedBy_Filter } +""" +✨ Generated Order input type based on DirectedBy +""" input DirectedBy_Order { + """ + ✨ + """ movieId: OrderDirection + """ + ✨ + """ directedbyId: OrderDirection + """ + ✨ + """ directedby: Person_Order + """ + ✨ + """ movie: Movie_Order } +""" +✨ Generated Data input type based on Movie +""" input Movie_Data { + """ + ✨ + """ id: UUID + """ + ✨ _expr server value of id + """ id_expr: UUID_Expr + """ + ✨ + """ description: String + """ + ✨ _expr server value of description + """ description_expr: String_Expr + """ + ✨ + """ genre: String + """ + ✨ _expr server value of genre + """ genre_expr: String_Expr + """ + ✨ + """ rating: Float + """ + ✨ + """ releaseYear: Int + """ + ✨ + """ title: String + """ + ✨ _expr server value of title + """ title_expr: String_Expr } +""" +✨ Generated Filter input type based on Movie +""" input Movie_Filter { _and: [Movie_Filter!] _not: Movie_Filter _or: [Movie_Filter!] + """ + ✨ + """ id: UUID_Filter + """ + ✨ + """ description: String_Filter + """ + ✨ + """ genre: String_Filter + """ + ✨ + """ rating: Float_Filter + """ + ✨ + """ releaseYear: Int_Filter + """ + ✨ + """ title: String_Filter + """ + ✨ + """ directedBies_on_movie: DirectedBy_ListFilter + """ + ✨ + """ people_via_DirectedBy: Person_ListFilter } +""" +✨ Generated Key input type based on Movie +""" +input Movie_Key { + """ + ✨ + """ + id: UUID + """ + ✨ _expr server value of id + """ + id_expr: UUID_Expr +} +""" +✨ Generated ListFilter input type based on Movie +""" input Movie_ListFilter { count: Int_Filter = {gt:0} exist: Movie_Filter } +""" +✨ Generated Order input type based on Movie +""" input Movie_Order { + """ + ✨ + """ id: OrderDirection + """ + ✨ + """ description: OrderDirection + """ + ✨ + """ genre: OrderDirection + """ + ✨ + """ rating: OrderDirection + """ + ✨ + """ releaseYear: OrderDirection + """ + ✨ + """ title: OrderDirection } +""" +✨ Generated Data input type based on Person +""" input Person_Data { + """ + ✨ + """ id: UUID + """ + ✨ _expr server value of id + """ id_expr: UUID_Expr + """ + ✨ + """ name: String + """ + ✨ _expr server value of name + """ name_expr: String_Expr } +""" +✨ Generated Filter input type based on Person +""" input Person_Filter { _and: [Person_Filter!] _not: Person_Filter _or: [Person_Filter!] + """ + ✨ + """ id: UUID_Filter + """ + ✨ + """ name: String_Filter + """ + ✨ + """ directedBies_on_directedby: DirectedBy_ListFilter + """ + ✨ + """ movies_via_DirectedBy: Movie_ListFilter } +""" +✨ Generated Key input type based on Person +""" +input Person_Key { + """ + ✨ + """ + id: UUID + """ + ✨ _expr server value of id + """ + id_expr: UUID_Expr +} +""" +✨ Generated ListFilter input type based on Person +""" input Person_ListFilter { count: Int_Filter = {gt:0} exist: Person_Filter } +""" +✨ Generated Order input type based on Person +""" input Person_Order { + """ + ✨ + """ id: OrderDirection + """ + ✨ + """ name: OrderDirection } +""" +✨ Generated Data input type based on TimestampHolder +""" input TimestampHolder_Data { + """ + ✨ + """ id: UUID + """ + ✨ _expr server value of id + """ id_expr: UUID_Expr + """ + ✨ + """ date: Date + """ + ✨ _date server value of date + """ date_date: Date_Relative + """ + ✨ _expr server value of date + """ date_expr: Date_Expr + """ + ✨ + """ timestamp: Timestamp + """ + ✨ _expr server value of timestamp + """ timestamp_expr: Timestamp_Expr + """ + ✨ _time server value of timestamp + """ timestamp_time: Timestamp_Relative } +""" +✨ Generated Filter input type based on TimestampHolder +""" input TimestampHolder_Filter { _and: [TimestampHolder_Filter!] _not: TimestampHolder_Filter _or: [TimestampHolder_Filter!] + """ + ✨ + """ id: UUID_Filter + """ + ✨ + """ date: Date_Filter + """ + ✨ + """ timestamp: Timestamp_Filter } +""" +✨ Generated Key input type based on TimestampHolder +""" +input TimestampHolder_Key { + """ + ✨ + """ + id: UUID + """ + ✨ _expr server value of id + """ + id_expr: UUID_Expr +} +""" +✨ Generated ListFilter input type based on TimestampHolder +""" input TimestampHolder_ListFilter { count: Int_Filter = {gt:0} exist: TimestampHolder_Filter } +""" +✨ Generated Order input type based on TimestampHolder +""" input TimestampHolder_Order { + """ + ✨ + """ id: OrderDirection + """ + ✨ + """ date: OrderDirection + """ + ✨ + """ timestamp: OrderDirection } diff --git a/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/mutation.gql b/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/mutation.gql index c36f32ea1eaa..a6cb8adf6f1f 100755 --- a/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/mutation.gql +++ b/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/mutation.gql @@ -1,130 +1,130 @@ extend type Mutation { """ - Insert a single DirectedBy into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert a single DirectedBy into the table. Columns not specified in `data` will receive defaults (e.g. `null`). """ - directedBy_insert(data: DirectedBy_Data!): DirectedBy_Key! @fdc_generated(from: "DirectedBy", purpose: INSERT_SINGLE) + directedBy_insert(data: DirectedBy_Data!): DirectedBy_KeyOutput! @fdc_generated(from: "DirectedBy", purpose: INSERT_SINGLE) """ - Insert a single Movie into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert a single Movie into the table. Columns not specified in `data` will receive defaults (e.g. `null`). """ - movie_insert(data: Movie_Data!): Movie_Key! @fdc_generated(from: "Movie", purpose: INSERT_SINGLE) + movie_insert(data: Movie_Data!): Movie_KeyOutput! @fdc_generated(from: "Movie", purpose: INSERT_SINGLE) """ - Insert a single Person into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert a single Person into the table. Columns not specified in `data` will receive defaults (e.g. `null`). """ - person_insert(data: Person_Data!): Person_Key! @fdc_generated(from: "Person", purpose: INSERT_SINGLE) + person_insert(data: Person_Data!): Person_KeyOutput! @fdc_generated(from: "Person", purpose: INSERT_SINGLE) """ - Insert a single TimestampHolder into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert a single TimestampHolder into the table. Columns not specified in `data` will receive defaults (e.g. `null`). """ - timestampHolder_insert(data: TimestampHolder_Data!): TimestampHolder_Key! @fdc_generated(from: "TimestampHolder", purpose: INSERT_SINGLE) + timestampHolder_insert(data: TimestampHolder_Data!): TimestampHolder_KeyOutput! @fdc_generated(from: "TimestampHolder", purpose: INSERT_SINGLE) """ - Insert DirectedBy entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert DirectedBy entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`). """ - directedBy_insertMany(data: [DirectedBy_Data!]!): [DirectedBy_Key!]! @fdc_generated(from: "DirectedBy", purpose: INSERT_MULTIPLE) + directedBy_insertMany(data: [DirectedBy_Data!]!): [DirectedBy_KeyOutput!]! @fdc_generated(from: "DirectedBy", purpose: INSERT_MULTIPLE) """ - Insert Movie entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert Movie entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`). """ - movie_insertMany(data: [Movie_Data!]!): [Movie_Key!]! @fdc_generated(from: "Movie", purpose: INSERT_MULTIPLE) + movie_insertMany(data: [Movie_Data!]!): [Movie_KeyOutput!]! @fdc_generated(from: "Movie", purpose: INSERT_MULTIPLE) """ - Insert Person entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert Person entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`). """ - person_insertMany(data: [Person_Data!]!): [Person_Key!]! @fdc_generated(from: "Person", purpose: INSERT_MULTIPLE) + person_insertMany(data: [Person_Data!]!): [Person_KeyOutput!]! @fdc_generated(from: "Person", purpose: INSERT_MULTIPLE) """ - Insert TimestampHolder entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`). + ✨ Insert TimestampHolder entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`). """ - timestampHolder_insertMany(data: [TimestampHolder_Data!]!): [TimestampHolder_Key!]! @fdc_generated(from: "TimestampHolder", purpose: INSERT_MULTIPLE) + timestampHolder_insertMany(data: [TimestampHolder_Data!]!): [TimestampHolder_KeyOutput!]! @fdc_generated(from: "TimestampHolder", purpose: INSERT_MULTIPLE) """ - Insert or update a single DirectedBy into the table, based on the primary key. Returns the key of the newly inserted DirectedBy. + ✨ Insert or update a single DirectedBy into the table, based on the primary key. Returns the key of the newly inserted DirectedBy. """ - directedBy_upsert(data: DirectedBy_Data!): DirectedBy_Key! @fdc_generated(from: "DirectedBy", purpose: UPSERT_SINGLE) + directedBy_upsert(data: DirectedBy_Data!): DirectedBy_KeyOutput! @fdc_generated(from: "DirectedBy", purpose: UPSERT_SINGLE) """ - Insert or update a single Movie into the table, based on the primary key. Returns the key of the newly inserted Movie. + ✨ Insert or update a single Movie into the table, based on the primary key. Returns the key of the newly inserted Movie. """ - movie_upsert(data: Movie_Data!): Movie_Key! @fdc_generated(from: "Movie", purpose: UPSERT_SINGLE) + movie_upsert(data: Movie_Data!): Movie_KeyOutput! @fdc_generated(from: "Movie", purpose: UPSERT_SINGLE) """ - Insert or update a single Person into the table, based on the primary key. Returns the key of the newly inserted Person. + ✨ Insert or update a single Person into the table, based on the primary key. Returns the key of the newly inserted Person. """ - person_upsert(data: Person_Data!): Person_Key! @fdc_generated(from: "Person", purpose: UPSERT_SINGLE) + person_upsert(data: Person_Data!): Person_KeyOutput! @fdc_generated(from: "Person", purpose: UPSERT_SINGLE) """ - Insert or update a single TimestampHolder into the table, based on the primary key. Returns the key of the newly inserted TimestampHolder. + ✨ Insert or update a single TimestampHolder into the table, based on the primary key. Returns the key of the newly inserted TimestampHolder. """ - timestampHolder_upsert(data: TimestampHolder_Data!): TimestampHolder_Key! @fdc_generated(from: "TimestampHolder", purpose: UPSERT_SINGLE) + timestampHolder_upsert(data: TimestampHolder_Data!): TimestampHolder_KeyOutput! @fdc_generated(from: "TimestampHolder", purpose: UPSERT_SINGLE) """ - Insert or update DirectedBy entries into the table, based on the primary key. Returns the key of the newly inserted DirectedBy. + ✨ Insert or update DirectedBy entries into the table, based on the primary key. Returns the key of the newly inserted DirectedBy. """ - directedBy_upsertMany(data: [DirectedBy_Data!]): [DirectedBy_Key!]! @fdc_generated(from: "DirectedBy", purpose: UPSERT_MULTIPLE) + directedBy_upsertMany(data: [DirectedBy_Data!]): [DirectedBy_KeyOutput!]! @fdc_generated(from: "DirectedBy", purpose: UPSERT_MULTIPLE) """ - Insert or update Movie entries into the table, based on the primary key. Returns the key of the newly inserted Movie. + ✨ Insert or update Movie entries into the table, based on the primary key. Returns the key of the newly inserted Movie. """ - movie_upsertMany(data: [Movie_Data!]): [Movie_Key!]! @fdc_generated(from: "Movie", purpose: UPSERT_MULTIPLE) + movie_upsertMany(data: [Movie_Data!]): [Movie_KeyOutput!]! @fdc_generated(from: "Movie", purpose: UPSERT_MULTIPLE) """ - Insert or update Person entries into the table, based on the primary key. Returns the key of the newly inserted Person. + ✨ Insert or update Person entries into the table, based on the primary key. Returns the key of the newly inserted Person. """ - person_upsertMany(data: [Person_Data!]): [Person_Key!]! @fdc_generated(from: "Person", purpose: UPSERT_MULTIPLE) + person_upsertMany(data: [Person_Data!]): [Person_KeyOutput!]! @fdc_generated(from: "Person", purpose: UPSERT_MULTIPLE) """ - Insert or update TimestampHolder entries into the table, based on the primary key. Returns the key of the newly inserted TimestampHolder. + ✨ Insert or update TimestampHolder entries into the table, based on the primary key. Returns the key of the newly inserted TimestampHolder. """ - timestampHolder_upsertMany(data: [TimestampHolder_Data!]): [TimestampHolder_Key!]! @fdc_generated(from: "TimestampHolder", purpose: UPSERT_MULTIPLE) + timestampHolder_upsertMany(data: [TimestampHolder_Data!]): [TimestampHolder_KeyOutput!]! @fdc_generated(from: "TimestampHolder", purpose: UPSERT_MULTIPLE) """ - Update a single DirectedBy based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found. + ✨ Update a single DirectedBy based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found. """ - directedBy_update(key: DirectedBy_Key, data: DirectedBy_Data!): DirectedBy_Key @fdc_generated(from: "DirectedBy", purpose: UPDATE_SINGLE) + directedBy_update(key: DirectedBy_Key, data: DirectedBy_Data!): DirectedBy_KeyOutput @fdc_generated(from: "DirectedBy", purpose: UPDATE_SINGLE) """ - Update a single Movie based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found. + ✨ Update a single Movie based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found. """ - movie_update(id: UUID, key: Movie_Key, data: Movie_Data!): Movie_Key @fdc_generated(from: "Movie", purpose: UPDATE_SINGLE) + movie_update(id: UUID, key: Movie_Key, data: Movie_Data!): Movie_KeyOutput @fdc_generated(from: "Movie", purpose: UPDATE_SINGLE) """ - Update a single Person based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found. + ✨ Update a single Person based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found. """ - person_update(id: UUID, key: Person_Key, data: Person_Data!): Person_Key @fdc_generated(from: "Person", purpose: UPDATE_SINGLE) + person_update(id: UUID, key: Person_Key, data: Person_Data!): Person_KeyOutput @fdc_generated(from: "Person", purpose: UPDATE_SINGLE) """ - Update a single TimestampHolder based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found. + ✨ Update a single TimestampHolder based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found. """ - timestampHolder_update(id: UUID, key: TimestampHolder_Key, data: TimestampHolder_Data!): TimestampHolder_Key @fdc_generated(from: "TimestampHolder", purpose: UPDATE_SINGLE) + timestampHolder_update(id: UUID, key: TimestampHolder_Key, data: TimestampHolder_Data!): TimestampHolder_KeyOutput @fdc_generated(from: "TimestampHolder", purpose: UPDATE_SINGLE) """ - Update DirectedBy entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. + ✨ Update DirectedBy entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. """ directedBy_updateMany(where: DirectedBy_Filter, all: Boolean = false, data: DirectedBy_Data!): Int! @fdc_generated(from: "DirectedBy", purpose: UPDATE_MULTIPLE) """ - Update Movie entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. + ✨ Update Movie entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. """ movie_updateMany(where: Movie_Filter, all: Boolean = false, data: Movie_Data!): Int! @fdc_generated(from: "Movie", purpose: UPDATE_MULTIPLE) """ - Update Person entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. + ✨ Update Person entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. """ person_updateMany(where: Person_Filter, all: Boolean = false, data: Person_Data!): Int! @fdc_generated(from: "Person", purpose: UPDATE_MULTIPLE) """ - Update TimestampHolder entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. + ✨ Update TimestampHolder entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. """ timestampHolder_updateMany(where: TimestampHolder_Filter, all: Boolean = false, data: TimestampHolder_Data!): Int! @fdc_generated(from: "TimestampHolder", purpose: UPDATE_MULTIPLE) """ - Delete a single DirectedBy based on `id` or `key` and return its key (or `null` if not found). + ✨ Delete a single DirectedBy based on `id` or `key` and return its key (or `null` if not found). """ - directedBy_delete(key: DirectedBy_Key): DirectedBy_Key @fdc_generated(from: "DirectedBy", purpose: DELETE_SINGLE) + directedBy_delete(key: DirectedBy_Key): DirectedBy_KeyOutput @fdc_generated(from: "DirectedBy", purpose: DELETE_SINGLE) """ - Delete a single Movie based on `id` or `key` and return its key (or `null` if not found). + ✨ Delete a single Movie based on `id` or `key` and return its key (or `null` if not found). """ - movie_delete(id: UUID, key: Movie_Key): Movie_Key @fdc_generated(from: "Movie", purpose: DELETE_SINGLE) + movie_delete(id: UUID, key: Movie_Key): Movie_KeyOutput @fdc_generated(from: "Movie", purpose: DELETE_SINGLE) """ - Delete a single Person based on `id` or `key` and return its key (or `null` if not found). + ✨ Delete a single Person based on `id` or `key` and return its key (or `null` if not found). """ - person_delete(id: UUID, key: Person_Key): Person_Key @fdc_generated(from: "Person", purpose: DELETE_SINGLE) + person_delete(id: UUID, key: Person_Key): Person_KeyOutput @fdc_generated(from: "Person", purpose: DELETE_SINGLE) """ - Delete a single TimestampHolder based on `id` or `key` and return its key (or `null` if not found). + ✨ Delete a single TimestampHolder based on `id` or `key` and return its key (or `null` if not found). """ - timestampHolder_delete(id: UUID, key: TimestampHolder_Key): TimestampHolder_Key @fdc_generated(from: "TimestampHolder", purpose: DELETE_SINGLE) + timestampHolder_delete(id: UUID, key: TimestampHolder_Key): TimestampHolder_KeyOutput @fdc_generated(from: "TimestampHolder", purpose: DELETE_SINGLE) """ - Delete DirectedBy entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted. + ✨ Delete DirectedBy entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted. """ directedBy_deleteMany(where: DirectedBy_Filter, all: Boolean = false): Int! @fdc_generated(from: "DirectedBy", purpose: DELETE_MULTIPLE) """ - Delete Movie entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted. + ✨ Delete Movie entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted. """ movie_deleteMany(where: Movie_Filter, all: Boolean = false): Int! @fdc_generated(from: "Movie", purpose: DELETE_MULTIPLE) """ - Delete Person entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted. + ✨ Delete Person entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted. """ person_deleteMany(where: Person_Filter, all: Boolean = false): Int! @fdc_generated(from: "Person", purpose: DELETE_MULTIPLE) """ - Delete TimestampHolder entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted. + ✨ Delete TimestampHolder entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted. """ timestampHolder_deleteMany(where: TimestampHolder_Filter, all: Boolean = false): Int! @fdc_generated(from: "TimestampHolder", purpose: DELETE_MULTIPLE) } diff --git a/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/query.gql b/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/query.gql index 3df5abe5d1cc..e08c6aa5b961 100755 --- a/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/query.gql +++ b/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/main/query.gql @@ -1,34 +1,34 @@ extend type Query { """ - Look up a single DirectedBy based on `id` or `key` and return selected fields (or `null` if not found). + ✨ Look up a single DirectedBy based on `id` or `key` and return selected fields (or `null` if not found). """ directedBy(key: DirectedBy_Key): DirectedBy @fdc_generated(from: "DirectedBy", purpose: QUERY_SINGLE) """ - Look up a single Movie based on `id` or `key` and return selected fields (or `null` if not found). + ✨ Look up a single Movie based on `id` or `key` and return selected fields (or `null` if not found). """ movie(id: UUID, key: Movie_Key): Movie @fdc_generated(from: "Movie", purpose: QUERY_SINGLE) """ - Look up a single Person based on `id` or `key` and return selected fields (or `null` if not found). + ✨ Look up a single Person based on `id` or `key` and return selected fields (or `null` if not found). """ person(id: UUID, key: Person_Key): Person @fdc_generated(from: "Person", purpose: QUERY_SINGLE) """ - Look up a single TimestampHolder based on `id` or `key` and return selected fields (or `null` if not found). + ✨ Look up a single TimestampHolder based on `id` or `key` and return selected fields (or `null` if not found). """ timestampHolder(id: UUID, key: TimestampHolder_Key): TimestampHolder @fdc_generated(from: "TimestampHolder", purpose: QUERY_SINGLE) """ - List DirectedBy entries in the table, optionally filtered by `where` conditions. + ✨ List DirectedBy entries in the table, optionally filtered by `where` conditions. """ directedBies(where: DirectedBy_Filter, orderBy: [DirectedBy_Order!], offset: Int, limit: Int = 100): [DirectedBy!]! @fdc_generated(from: "DirectedBy", purpose: QUERY_MULTIPLE) """ - List Movie entries in the table, optionally filtered by `where` conditions. + ✨ List Movie entries in the table, optionally filtered by `where` conditions. """ movies(where: Movie_Filter, orderBy: [Movie_Order!], offset: Int, limit: Int = 100): [Movie!]! @fdc_generated(from: "Movie", purpose: QUERY_MULTIPLE) """ - List Person entries in the table, optionally filtered by `where` conditions. + ✨ List Person entries in the table, optionally filtered by `where` conditions. """ people(where: Person_Filter, orderBy: [Person_Order!], offset: Int, limit: Int = 100): [Person!]! @fdc_generated(from: "Person", purpose: QUERY_MULTIPLE) """ - List TimestampHolder entries in the table, optionally filtered by `where` conditions. + ✨ List TimestampHolder entries in the table, optionally filtered by `where` conditions. """ timestampHolders(where: TimestampHolder_Filter, orderBy: [TimestampHolder_Order!], offset: Int, limit: Int = 100): [TimestampHolder!]! @fdc_generated(from: "TimestampHolder", purpose: QUERY_MULTIPLE) } diff --git a/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/prelude.gql b/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/prelude.gql index 54eee276ad8a..ecafb65a9e1e 100755 --- a/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/prelude.gql +++ b/packages/firebase_data_connect/firebase_data_connect/example/dataconnect/.dataconnect/schema/prelude.gql @@ -47,6 +47,17 @@ directive @auth( expr: Boolean_Expr @fdc_oneOf(required: true) ) on QUERY | MUTATION + +""" +By default, a mutation operation executes each top-level field sequentially, +continuing to the next statement even if an error occurs. + +To ensure all mutation operations are atomic, you can put `@transation` on the +mutation. It will execute all top-level fields within a single database transaction +and will roll back all statements if any errors. +""" +directive @transaction on MUTATION + """ Marks an element of a GraphQL operation as no longer supported on the client. The Firebase Data Connect backend will still support this element, but it will diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_timestamps.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_timestamps.dart index 03827da22a93..4f006d5cc269 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_timestamps.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_timestamps.dart @@ -32,7 +32,7 @@ class ListTimestampsTimestampHolders { json['timestamp'] = timestamp.toJson(); if (date != null) { - json['date'] = nativeToJson(date); + json['date'] = nativeToJson(date); } return json; diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/movies.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/movies.dart index 067d78201f76..83ddcc5459a9 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/movies.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/movies.dart @@ -1,7 +1,16 @@ library movies; + import 'package:firebase_data_connect/firebase_data_connect.dart'; import 'dart:convert'; +part 'list_movies.dart'; + +part 'list_movies_by_partial_title.dart'; + +part 'list_persons.dart'; + +part 'list_timestamps.dart'; + part 'add_person.dart'; part 'add_director_to_movie.dart'; @@ -14,58 +23,46 @@ part 'create_movie.dart'; part 'delete_movie.dart'; -part 'list_movies.dart'; - -part 'list_movies_by_partial_title.dart'; - -part 'list_persons.dart'; +class MoviesConnector { + ListMovies get listMovies { + return ListMovies(dataConnect: dataConnect); + } -part 'list_timestamps.dart'; + ListMoviesByPartialTitle get listMoviesByPartialTitle { + return ListMoviesByPartialTitle(dataConnect: dataConnect); + } + ListPersons get listPersons { + return ListPersons(dataConnect: dataConnect); + } + ListTimestamps get listTimestamps { + return ListTimestamps(dataConnect: dataConnect); + } -class MoviesConnector { - AddPerson get addPerson { return AddPerson(dataConnect: dataConnect); } - + AddDirectorToMovie get addDirectorToMovie { return AddDirectorToMovie(dataConnect: dataConnect); } - + AddTimestamp get addTimestamp { return AddTimestamp(dataConnect: dataConnect); } - + AddDateAndTimestamp get addDateAndTimestamp { return AddDateAndTimestamp(dataConnect: dataConnect); } - + CreateMovie get createMovie { return CreateMovie(dataConnect: dataConnect); } - + DeleteMovie get deleteMovie { return DeleteMovie(dataConnect: dataConnect); } - - ListMovies get listMovies { - return ListMovies(dataConnect: dataConnect); - } - - ListMoviesByPartialTitle get listMoviesByPartialTitle { - return ListMoviesByPartialTitle(dataConnect: dataConnect); - } - - ListPersons get listPersons { - return ListPersons(dataConnect: dataConnect); - } - - ListTimestamps get listTimestamps { - return ListTimestamps(dataConnect: dataConnect); - } - static ConnectorConfig connectorConfig = ConnectorConfig( 'us-west2', @@ -82,4 +79,3 @@ class MoviesConnector { FirebaseDataConnect dataConnect; } -