react-relay

relay refetch doesn't show the result

不想你离开。 提交于 2019-12-22 10:40:37
问题 I'm trying to create a live search-result component(lazy load one). It works perfectly for the first time but refetch doesn't update the data. I see the request and respoonse in Network tab! so it does get the data, but it doesn't supply it to the component! any idea why? import React, { Component } from 'react'; import { createRefetchContainer, graphql, } from 'react-relay'; import ProfileShow from './ProfileShow'; class ProfileList extends Component { render() { console.log("rendering....",

AddMutation using relay modern graphql

倾然丶 夕夏残阳落幕 提交于 2019-12-13 03:36:29
问题 I'm trying to add a user using relay , below is my schema file schema.graphql createUser(input: CreateUserInput!): UserPayload input CreateUserInput { clientMutationId: String data: CreateUserData! } type CreateUserData { firstName: String! lastName: String! password: String! email: String } type UserPayload { clientMutationId: String node: User } type User { id: ID! firstName: String! lastName: String! email: String password: String } below is my mutation file , AddUserMutation.js const

React relay injectNetworkLayer is not a function

删除回忆录丶 提交于 2019-12-12 17:57:35
问题 I am following the tutorial from lynda: "Building and Deploying a Full-Stack React Application", in the chapter "Injecting the Relay Network Layer". there is in index.js, an attempt to set up a network layer, and the program compiles successfully but I'm receiving the following error in the browser: TypeError: __WEBPACK_IMPORTED_MODULE_4_react_relay___default.a.injectNetworkLayer is not a function index.js file is: import React from 'react' import ReactDOM from 'react-dom' import {Router,

Relay modern caching example

旧街凉风 提交于 2019-12-06 03:33:39
问题 I would like to enable caching in my react native application. I am using GraphQL with Relay modern. I found out that caching is not enabled by default in relay modern, but they have exposed RelayQueryResponseCache from relay-runtime , which we can add to the fetchQuery function in our API. I read discussion here and here about it, but have not seen any example to get started. Can someone help me out on this? EDIT: Ok I came up with a solution. I think it misses few things but so far it