relaymodern

    1熱度

    2回答

    鑑於以下QueryRenderer組件: class ProjectQueryRenderer extends Component { constructor(props) { super(props); this.renderProjectList = this.renderProjectList.bind(this); } renderPro

    2熱度

    1回答

    我正在使用Relay Modern構建一個應用程序,作爲我第一次真正進入React,Relay和GraphQL的應用程序。 基本情況是,我有一個登錄表單組件,它並不需要任何數據;也就是說,組件呈現一個表單,並且具有相應的突變,但不需要查詢任何內容。 當調用createFragmentContainer時,似乎提供中繼樣式查詢片段是必需的,這又確保this.props.relay在組件上下文中不會是

    6熱度

    1回答

    我試圖測試反應繼電器現代容器,但我有這個問題。 TypeError: Cannot read property 'environment' of undefined 下面是測試代碼: test('render component',() => { const tree = renderer.create( <User />, ).toJSON(); expect

    1熱度

    1回答

    如何取消訂閱接力現代訂閱? 我已經按照How to GraphQL React + Relay上的訂閱教程,但它沒有提及如何取消訂閱或者是否使用Relay Modern網站。 任何幫助都會很棒。 UPDATE ---------- 據李拜倫(see GitHub issue),你只需要調用dispose() 在requestSubscription() 作出以下修改後,例如: ./src/subs

    3熱度

    1回答

    我在我的陣營項目如下設置: export default class OverviewScreen extends React.Component<any, any> { public render() { return ( <QueryRenderer environment={environment} query={OverviewScre

    2熱度

    2回答

    我使用的是react-relay/compat 1.1.0,我需要編寫一個能夠上傳文件的變種。 繼電器經典,你可以使用getFiles()支持文件上傳突變: class AddImageMutation extends Relay.Mutation { getMutation() { return Relay.QL`mutation{ introduceImage }`;

    0熱度

    2回答

    我在試圖找出如何在不傳遞(新)變量的情況下觸發新現代RefreshContainer中的刷新? 我正在尋找最好的方法來實現良好的'拉到刷新React本機列表,應該只需重新查看原始查詢 - 不需要變量? 根據文檔(https://facebook.github.io/relay/docs/api-cheatsheet.html)這應該使用 this.props.relay.refetch({}, c

    0熱度

    1回答

    我有在響應此錯誤: 不能用於非可空場TodoEdge.cursor返回null。 這是我的突變代碼: mutateAndGetPayload: async ({text}, context) => { let newTodo = new TodoModel({ text, _creatorUserId: context.user._id }); await newTodo.

    1熱度

    2回答

    在我的服務器上,我的GraphQL實現使用Flask,Graphene和SQLAlchemy。理想情況下,我想能夠簡單地操縱頭和返回401錯誤響應,但GraphQL返回的一切,200 使用flask.abort(401),但是我至少能得到這樣的響應: ... "errors": [ { "message": "401 Unauthorized: The server coul

    0熱度

    1回答

    我正在嘗試在我的模式中創建一個分頁繼電器& graphql。這是我的代碼: const GraphQLFriendByUser = new GraphQLObjectType({ name: 'FriendByUser', fields: { id: globalIdField('FriendByUser'), _id: { type: Grap