In schema I have
type Organization @table {
id: UUID! @default(expr: "uuidV4()")
slug: String! @col(dataType: "varchar(255)") @unique @index
name: String! @col(dataType: "varchar(200)")
logo: String
createdAt: Date! @default(expr: "request.time")
updatedAt: Date! @default(expr: "request.time")
owner: User!
}
I want to create a new record using this
mutation CreateOrganization($name: String!, $slug: String, $logo: String)
@auth(level: USER) {
anization_insert(
data: {
name: $name
slug: $slug
ownerId_expr: "auth.uid"
logo: $logo
}
)
}
But I would like it to return more data than just the id, however in the dataconnect/.dataconnect/schema/main/mutation.gql
it creates
"""
✨ Insert a single `Organization` into the table. Columns not specified in `data` will receive defaults (e.g. `null`).
"""
anization_insert(
"""
Data object to insert into the table.
"""
data: Organization_Data!
): Organization_KeyOutput! @fdc_generated(from: "Organization", purpose: INSERT_SINGLE)
Which doesn't allow any other values. Is there a better way to make this happen so I don't have to call right after to get the slug?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745111496a4611878.html
评论列表(0条)