2016-02-21 19 views
1

我們使用TODO示例。在TodoList它(81號線)具有如果我添加一個循環片段組成如何在Relay中工作?

this.props.viewer.todos.edges.map(edge => 
console.log(edge.node.text) 
); 

起作用renderTodos()在第30行作爲

todos(status: $status, first: $limit) { 
    edges { 
    node { 
     id, 
     ${Todo.getFragment('todo')}, 
    }, 
    }, 
    .... 
} 

現在組成片段,它會輸出未定義

有趣的是,如果我們將文本添加到如下的片段中

todos(status: $status, first: $limit) { 
    edges { 
    node { 
     id, 
     text, 
     ${Todo.getFragment('todo')}, 
    }, 
    }, 
    .... 
} 

它實際上是「申報」 文本兩次(在待辦事項組件聲明以及)和環路完美的作品。

我的問題是,爲什麼即使它們由Graphql Server返回,也無法從構圖中獲取「屬性」?

回答