Questions tagged [react-router-relay]

react-router-relay is a tool used for integrating the react-router library into a Relay.js environment. Use this tag when using the react-router-relay library in your project.

react-router-relay (not to be confused with react-router) is a tool used when integrating the react-router library into a Relay.js environment.

react-router-relay will automatically generate a combined Relay query config with all queries and parameters from the active React Router routes, then pass down the query results to each of the route components.

Useful links

react-router-relay on GitHub

react-router-relay on npm

Related tags

46 questions
2
votes
0 answers

Changing variables of query in progress with relayjs

Is it possible to somehow change the query variables for query in progress? My idea is that I'm storing number of showed items in route state with variable called pageSize. Now when user opens one item and press back button in browser, I will show…
M.Svrcek
  • 5,485
  • 4
  • 25
  • 33
2
votes
0 answers

Callback when route is completely rendered

The onUpdate callback of router seems to be called when rendering is initiated, is there any other way to call a function after all the components are rendered? Something alike ReactDOM.render callback...
seldon
  • 977
  • 2
  • 8
  • 20
2
votes
0 answers

Invalid prop/context `relay`

I did a fresh npm install and suddenly am getting the following error warning.js?8a56:44 Warning: Failed context type: Invalid prop/context relay supplied to Relay(FilesPage), expected undefined to be an object conforming to the RelayEnvironment…
azium
  • 20,056
  • 7
  • 57
  • 79
2
votes
1 answer

Nested Routes in react-router-relay

I'm running into some trouble with react-router-relay and nested routes. I have a router setup like the following:
Chris Martin
  • 1,871
  • 16
  • 17
1
vote
0 answers

how to call multiple queries inside relay fragments?

export default Relay.createContainer(Component,{ initialVariables :{ state:null }, fragments:{ store :() => Relay.QL` fragment on Store { stateInfo(state : $state){ //Repeat taking a state value from a list ["AZ","AK"...} …
Sumanth
  • 477
  • 1
  • 6
  • 11
1
vote
1 answer

Relay's Inject Network Layer Not Being Recognized as a Function in a React App

I am following along a Lynda.com tutorial called "Building and Deploying a Full-Stack React Application", and 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…
1
vote
0 answers

Handling query failures in react-router-relay

I am new to Relay and am working on a small project using react-relay/classic with react-router-relay. I am trying to decide the best way to implement simple error handling for the case where a query fails. I am just looking for a "catch all" system…
Phil Bellamy
  • 310
  • 3
  • 11
1
vote
0 answers

Relay router, deprecate fetch on first render

I have met next issue. In my app I use relay, custom network layer and relay-router For plain route I declare query, that fetch some data: const ViewerQuery = { viewer: Component => Relay.QL` query { viewer { …
PickUp
  • 11
  • 3
1
vote
0 answers

Creating new Type Definitions for react-router-relay

I want to create Typescript definitions for react-router-relay but the extending nature of react-router-relay is giving me a hard time. react-router is exposing a Router Component with some properties, also including a render property.…
velop
  • 3,102
  • 1
  • 27
  • 30
1
vote
1 answer

Relay generating invalid query after using `setVariables`-- am I doing something wrong?

For some reason, if I generate a root query which takes in parameters before injecting the child component, like so: import Relay from 'react-relay'; export default { production: (Component) => Relay.QL` query { getProduction(id:…
1
vote
0 answers

Combining queries in nested react-router-relay routes

I have a schema with a viewer as topmost root element and all other data under it: the viewer has a list of users and supplies a single user(id). There is no other element in my root query. My root component has defined following routes:
Michael Hilus
  • 1,647
  • 2
  • 21
  • 42
1
vote
1 answer

Accessing a url parameter to use in a query using react-router-relay

I am using react-router and react-router-relay to handle routing on my app. I am having a problem trying to access the id param that is passed in the url path. What is the correct way to do this? routes.js import CreativeQuery from…
1
vote
0 answers

How to avoid multiple node queries?

I have 3 pages (components using react-router-relay) in my app, ProductList, ProductDetail and BrandList. To illustrate the problem, let me walk through the flow and leave the code at the bottom. First I go to ProductList and see the list of…
Jeff.A
  • 191
  • 1
  • 6
1
vote
0 answers

Relayjs performance really bad, setVariables

Does anyone know what causes these huge blocking functions in Relay when making requests? I have a search box that calls setVariables and it's immensely noticeable. It's much better in production. Still curious though
azium
  • 20,056
  • 7
  • 57
  • 79
1
vote
0 answers

Relay transform error - Unexpected character "\u2028"

Since upgrading React and Babel, I'm getting this error in one of my files. It is clearly a phantom error as everything worked fine before and this file wasn't changed at all. Does anyone have a clue what is happening here and how I can fix it? The…
alengel
  • 4,368
  • 3
  • 21
  • 28