Firebase Dataconnect how to return more data while using implicit mutations - Stack Overflow

In schema I havetype Organization @table {id: UUID! @default(expr: "uuidV4()")slug: String!

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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信