AWS Amplify - GraphQL 与现有认知用户池的多对多关系

问题描述

在 AWS amplify 文档中,我了解了用户评论的多对多关系的以下实现。

    type Post @model {
  id: ID!
  title: String!
  editors: [PostEditor] @connection(keyName: "byPost",fields: ["id"])
}

# Create a join model and disable queries as you don't need them
# and can query through Post.editors and User.posts
type PostEditor
  @model(queries: null)
  @key(name: "byPost",fields: ["postID","editorID"])
  @key(name: "byEditor",fields: ["editorID","postID"]) {
  id: ID!
  postID: ID!
  editorID: ID!
  post: Post! @connection(fields: ["postID"])
  editor: User! @connection(fields: ["editorID"])
}

type User @model {
  id: ID!
  username: String!
  posts: [PostEditor] @connection(keyName: "byEditor",fields: ["id"])
}

但是我想知道如何用我现有的 Cognito 用户池替换用户类型以实现相同的目标? https://docs.amplify.aws/cli/graphql-transformer/connection#many-to-many-connections

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)