[英]relay-compiler unable to extract and use graphql queries in Typescript
[英]Is there way to use Relay without GraphQL?
我正在我的React應用程序中嘗試Relay,它默認使用GraphQL。 看起來像這樣( Score
是一些React.js組件):
Score = Relay.createContainer(Score, {
fragments: {
score: () => Relay.QL`
fragment on Score {
initials,
score,
}
`,
},
});
問題是:我可以使用自定義API函數將數據返回為片段嗎? 像這樣:
Score = Relay.createContainer(Score, {
fragments: {
score: myCustomFunction(), // It will return a dataset.
},
});
還沒有。 在GitHub問題中討論了使用“本地”數據擴展服務器架構的支持。
同時,您有兩個選擇:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.