Questions tagged [relaymodern]

143 questions
12
votes
2 answers

Relay Modern RefetchContainer props aren't passed to component

I'm having some issues setting up a refetchContainer in Relay Modern. A parent component is the QueryRenderer, which runs an initial query, populating the child component's props appropriately (a-prop-riately? eh? eh?!) . The refetchContainer…
cntrlz
  • 121
  • 6
10
votes
3 answers

Where the data is Storing in Graphql

I started to use graphQl with react relay. And I followed some tutorials and I can able to get and post with the help of mutations and queries. Everything works fine but my question here is, Where qraphql is saving the data and fetching that for…
10
votes
1 answer

Pass variables to fragment container in relay modern

I'm using Relay Modern (compat). I have a fragment that contains a field that has one argument, but I can't find a way of passing the variable value from the parent component: // MyFragmentComponent.jsx class MyFragmentComponent extends Component…
Maikel Ruiz
  • 1,023
  • 1
  • 11
  • 21
7
votes
2 answers

relay modern: how to mock relay for unit testing

Am trying to test react relay modern container, but am having this issue. TypeError: Cannot read property 'environment' of undefined Here is the test code: test('render component', () => { const tree = renderer.create( , …
user3462064
  • 263
  • 3
  • 17
6
votes
0 answers

Refetch container refetches, but does not update the view

My application looks something like what's included in the snippets below. (I've left out a lot of the implementation details in the hopes that the code below is sufficient to get my question across). SampleApp.js const SampleAppQuery = graphql` …
5
votes
1 answer

Setting up multiple network layers in Relay Modern

I am using a react-native app with relay modern. Currently our app's fetchQuery implementation, just does a fetch on the network (like in https://facebook.github.io/relay/docs/en/network-layer.html), Although there is a possibility of another…
jay shah
  • 728
  • 4
  • 16
5
votes
0 answers

How to send data from fragment to deep nested component?

I'm working with Relay Modern on Project. But I'm not sure how to send data from a place when I put fragment to place where Is component placed. for example: this is components composition -Page (QueryRenderer) ---Header ---body ---List …
Grund
  • 269
  • 1
  • 2
  • 11
4
votes
1 answer

How can I share the same form for creating and updating an object in relay-modern (experimental)?

I am new to relay and I'm attempting to use relay modern experimental in concurrent mode. I have been able to load nodes, edges, etc just fine with Suspense and ErrorBoundary. I'm now working on a form for create and update of an object. I can't…
Duane
  • 191
  • 9
4
votes
1 answer

In Relay.js, what is the `Client Mutation Identifier`?

In the relay documentation here, it says that: Relay uses a common pattern for mutations, where there are root fields on the mutation type with a single argument, input, and where the input and output both contain a client mutation identifier used…
davidx1
  • 2,878
  • 6
  • 31
  • 54
4
votes
0 answers

Missing fields in graphql mutation payload

I'm new in graphql. I need to perform a mutation using Relay Modern in a React app. According to docs mutation payload can be different from success response to error response. Everything goes fine with success response, but with error response I…
4
votes
2 answers

React useState giving previous state value always

I am new to React Hooks and trying to build functional component. In my component i have two calendar which user can select date range. As user select date, i need to update my query. I try using useState but my state value is always stole and…
jvm
  • 1,518
  • 7
  • 24
  • 44
4
votes
1 answer

fragment cannot be spread here as objects of type "Query"

Trying out relay with react and ran into this today. Here is what I've done so far. Root Query: query { tasks { id taskName taskStatus userId } } React component hierarchy App ↳--TaskList (props: tasks) ↳--TaskListItem…
Giridhar Karnik
  • 1,854
  • 1
  • 24
  • 40
4
votes
0 answers

Relay modern: refetch doesn't update props

I'm trying to use createRefetchContainer of the Relay Modern. but the props aren't passed down to my component from the result of the refetch query. The refetch query runs okay and the response will come back from the server, but the ui doesn't get…
Mani Shooshtari
  • 650
  • 1
  • 6
  • 19
4
votes
2 answers

React Relay Modern redirecting to another page when receiving 401 error on network environment

I´m using JWT authentication inside my ReactJS RelayJS network environment. All the token retrieval and processing in server and client are fine. I´m using react router v4 for routing. My problem is when I receive a Unauthorized message from server…
Mendes
  • 13,757
  • 24
  • 122
  • 217
4
votes
0 answers

how to pass dynamic arguments in Relay modern?

I have specific requirement in Relay-Modern to pass current date as arguments. From which i understand it's not possible in Relay-Modern as we can not write any code in initialVariables(was part of Relay Classic Api) as this step is now shifted to…
Anil Sharma
  • 235
  • 1
  • 4
  • 15
1
2 3
9 10