微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。