0
我有这样的片段:在Relay中获取迭代节点变量并在getFragment中使用?
fragments: {
Viewer:() => Relay.QL`
fragment house on Viewer {
House(id:$id){
id
baths
beds
built
city {
name
}
description
image
mls
price
street
type {
type
}
zip {
code
}
}
}
`,
},
当我遍历列表中的房子边缘节点我想获得这个片段和重用:
Houses(city: $city, zip: $zip, type: $type, first: 20) {
edges {
node {
id
${HousePage.getFragment('Viewer').getFragment('house')}
}
}
}
如何从获得ID节点和请求从另一个组件的房子片段?我花了4个小时..... OMG。