【发布时间】:2018-09-06 04:44:09
【问题描述】:
我在使用 AWS AppSync 和 ApolloClient 时遇到问题。 如何在名为 AppSync 的 Amazon 服务中使用用户之间的关联,即作为节点和边缘的连接。我想做的是当我关注用户时,我想通过一个请求查看所有用户的流程。 这是我想成为的要求。如何为此构建结构?
query {
getFeeds(id:"myUserId") {
following {
userFeed {
id
ImageDataUrl
textData
date
}
}
}
}
我创建的架构如下
type Comments {
id: ID!
date: Int!
message: String!
user: User
}
type Feed {
id: ID!
user: User!
date: Int!
textData: String
ImageDataUrl: String
VideoDataUrl: String
likes: Like
comments: [Comments]
}
#Objects
type Like {
id: ID!
number: Int!
likers: [User]
}
}
type Query {
getAllUsers(limit: Int): [User]
}
type User {
id: ID!
name: String!
email: String!
imageUrl: String!
imageThumbUrl: String!
followers: [User]
following: [User]
userFeed: [Feed]
}
schema {
query: Query
}
【问题讨论】:
标签: amazon-web-services amazon-dynamodb graphql apollo aws-appsync