46 questions
1
vote
0
answers
613
views
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 ...
2
votes
2
answers
394
views
React relay injectNetworkLayer is not a function
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 ...
1
vote
1
answer
408
views
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 ...
1
vote
0
answers
82
views
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 ...
0
votes
1
answer
1k
views
'.' is not recognized as an internal or external command for relay full stack
I am trying to use relay full stack.
https://github.com/lvarayut/relay-fullstack
But I am getting an error like
'.' is not recognized as an internal or external command,
operable program or batch ...
2
votes
0
answers
129
views
How to cache already loaded data and stored in Relay?
I have some panel (A) showing a list of events. The panel initially loads 10 items. The user can load more items by clicking a button. The processing is handled by loadmore(). loadmore() also updates ...
12
votes
1
answer
950
views
Relay: How to merge instead of override queries in nested routes?
I cannot navigate to /users in my app, because it doesn`t trigger fetching of all queries that I would expect it should.
My app consists of an App component and some components that contain actual ...
1
vote
0
answers
34
views
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`
...
0
votes
1
answer
678
views
Graphene Django and react-router-relay
I'm having real trouble figuring out the way that Graphene Django should be used with react-router-relay. Let's say I can use the following GraphQL query fine via the GraphiQL console on my Django ...
13
votes
1
answer
285
views
How to wire data to a deep component in react-router-relay?
I have a route like this
<Route path="/search" component={Search}>
The basic Search component looks likes this
class Search extends React.Component {
constructor (props) {
super(props)
...
0
votes
1
answer
815
views
Can I pull deeply-nested nodes from a Relay query result?
My goal is to combine multiple nested sibling arrays of edges from the same Relay fragment into one render call.
Backend data is delivered via Relay containers (also using react-router-relay).
I ...
0
votes
1
answer
128
views
Single-Page App Sharing Relay Variables
I'm currently experimenting with a single page application implementation that consists of a Layout component and swapping numerous Page components nested inside. The Relay containers on the Layout ...
2
votes
0
answers
41
views
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 ...
16
votes
2
answers
648
views
Augment react-router module with react-router-relay typings
The default react-router is used as such:
import * as React from 'react';
import { Router, Route, hashHistory } from 'react-router';
const routing = (
<Router history={hashHistory}>
...
0
votes
1
answer
732
views
Retrieving variables for a Relay query fragment from an external store
When writing a GraphQL query fragment as part of a RelayContainer, I've been struggling with how to set query variables in certain situations. The basics outlined in the documentation are simple ...
3
votes
0
answers
278
views
How to detect relay environment change if react-router-relay is used?
Perhaps this is very specific question, but i believe it would be find to find solution. I find a lot of people ask about environment change after login/logout.
I'm using redux to store app state ...
1
vote
0
answers
225
views
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,...
1
vote
1
answer
65
views
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) => ...
2
votes
0
answers
229
views
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 ...
1
vote
1
answer
428
views
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?
...
0
votes
1
answer
1k
views
How to fetch and display item by id using Relay container, react-router and GraphQL
I am having a really hard time trying to get my head around Relay routes, react-router params and building the queries and containers in general!
I want to edit a Feature when the user clicks on a ...
2
votes
0
answers
211
views
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 ...
1
vote
0
answers
85
views
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.
...
0
votes
1
answer
2k
views
Clearing cache for log out in Relay.js app
I have a Relay app and I want to clear cache for a component that displays after logging in. I tried passing a currentRelay.store into my Relay.Router and implementing a currentRelay.reset() which ...
2
votes
0
answers
588
views
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 ...
1
vote
0
answers
170
views
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. ...
3
votes
1
answer
312
views
Update react-router and react-router-relay to v2.x from v1.x (Location "/" did not match any routes)
I'm trying to update react-router to v2.6 and react-router-relay to v0.7 in my app but I'm struggling to follow the changelogs to address all breaking changes. I think I addressed all changes but I ...
1
vote
0
answers
249
views
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 ...
1
vote
2
answers
2k
views
Cannot read property 'after' of undefined in implementing react-relay
In my nodejs application
here is my schema.js file
import {
GraphQLBoolean,
GraphQLID,
GraphQLInt,
GraphQLList,
GraphQLNonNull,
GraphQLObjectType,
GraphQLSchema,
GraphQLString,
} ...
3
votes
0
answers
273
views
Pass loading state props to root component with Relay
This seems like a basic idea but I can't seem to wrap my head around it.
In Redux, defining what happens to the store and which props I pass to components is entirely up to me. In Relay, I can define ...
1
vote
1
answer
128
views
Is react-router-relay inconsistent with the Relay pattern?
I'm using react-router-relay in a project. The design seems off to me given that every component basically ends up with a fragment having the same name as the root query. Shouldn't each component be ...
4
votes
1
answer
976
views
GraphQL with React Router Relay: Expected type Int, found String for numeric route
I have the following Router and routes using the react-router-relay package
ReactDOM.render(
<Router
history={browserHistory}
render={applyRouterMiddleware(useRelay)}
...
0
votes
1
answer
2k
views
npm start but see error
I start npm but see error , i don't know fix. please help me
"D:\PhpStorm 2016.1.2\bin\runnerw.exe" D:\nodejs\node.exe D:\nodejs\node_modules\npm\bin\npm-cli.js run-script start
> [email protected] ...
3
votes
1
answer
437
views
Sub route queries error for react-router-relay
Part of my route is set up like so:
<Route path=":widgetId" component={Widget} queries={{
viewer: () => Relay.QL`query { viewer }`,
widget: () => Relay.QL`query { widget(widgetId: $...
6
votes
1
answer
530
views
Relay/router login mutation?
I'm trying to implement a mutation for login. The mutation validates the provided id_token and logs the user in via sessions. The mutation itself works (verified with GraphiQL), but I'm having issues ...
7
votes
2
answers
962
views
Access React component from this.props.children with react-router
I have a website with the following react-router and react-router-relay setup:
main.jsx:
<Router history={browserHistory} render={applyRouterMiddleware(useRelay)}>
<Route path="/:...
4
votes
1
answer
3k
views
How to make Relay and React Routing work properly?
I am starting out with Relay and trying to make my routing work properly.
Unfortunately, I am not having much of luck.
Here is the error I am getting:
Uncaught TypeError: Component.getFragment is ...
1
vote
2
answers
860
views
Can't get userID route parameter to work on react-router-relay
I'm trying to learn React Relay and GraphQL using react-relay-router but can't get params in my routes to work. My difficulty is at the "/Maps/:userID" route.
Here's my router:
ReactDOM.render(
...
3
votes
1
answer
973
views
react-router-relay: handle sucess or error on mutation
What's the best way to handle success or error after a mutation?
I'm using React.js and react-router-relay to make graphQL queries and mutations.
Let's say I have a React component performing a ...
1
vote
1
answer
306
views
React relay+router does not collapse queries of nested routes
I read on the react-router-relay that:
react-router-relay will automatically generate a combined Relay route
with all queries and parameters from the active React Router routes,
then pass down ...
0
votes
1
answer
576
views
server side rendering with react-router-relay and react-rails
My server side is rails and I'm using react-rails with server side rendering (prerender: true). Recently started using relay with react-router-relay but with that, server side rendering is no longer ...
2
votes
1
answer
650
views
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:
<Route path='/' component={App}>
<IndexRoute component={EventList}/&...
1
vote
2
answers
2k
views
Multiple react-router-relay routes using same Relay root query with different fragment fields
I am running into an issue where when requesting data within two adjacent react-router-relay route components using the same root query, the graphql server query in the second route component ...
0
votes
1
answer
751
views
how to pass value to the root query in react-router-relay
Suppose that I have the following root query in a relay with react-router-relay project:
export default {
calc: () => Relay.QL`query queryType ($number: String) { auth (number: $number) }`,
}
...
5
votes
2
answers
5k
views
How to pass variables between Relay Containers
I'm looking for the good syntax to pass a variable from a parent container to a child container.
Let's say I have theses routes, with a global widget list on / and specific widget lists on /widgets/:...
0
votes
3
answers
1k
views
How do you move from stock Relay to Relay with a router?
I have a React/Relay app that is currently working that I would like to add routing to using react-router-relay. When I try the minimum possible conversion, see the code below, I get an ...