我有这样的片段:
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。