Questions tagged [relaymodern]

145 questions
3
votes
2 answers

How to unsubscribe in Relay Modern

How do you unsubscribe from a subscription in Relay Modern? I have followed the subscription tutorial on How to GraphQL React + Relay but it has no mention on how you unsubscribe either does the Relay Modern website. Any help would be…
Andrew Hunt
  • 554
  • 1
  • 4
  • 11
3
votes
0 answers

relay refetch doesn't show the result

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…
3
votes
1 answer

`updater` not working with Relay Modern because `ConnectionHandler.getConnection()` returns `undefined`

I'm using Relay Modern for my app and am trying to update the cache after a mutation using the updater and optimisticUpdater but it doesn't quite work. Basically, I have a Link type with a votes connection - here's the relevant part of my…
nburk
  • 22,409
  • 18
  • 87
  • 132
2
votes
0 answers

React Error boundary unexpected behavior with material ui popover

There is a notifications component within a popover that makes a fetch call. The connection fails and cannot reach the resources. The error boundary component wraps the notifications component. It is expected that after the connection fails, will…
2
votes
2 answers

Building a Relay GraphQL server with graphql-java

We're using graphql-java to build a graphql server and having trouble conforming to the Relay spec. According to the Relay spec, all nodes must be retrievable via a single query: node(id: ID). The graphql-java docs show support for Relay's node…
2
votes
2 answers

Relay Modern: delete record in optimisticUpdater

In my app I have a mutation where I want to use the optimisticUpdater to update the view before the server response. For that I need to remove some records from a list into the relay store, like that: optimisticUpdater: storeProxy => { …
Robel Tekle
  • 39
  • 1
  • 6
2
votes
0 answers

General API Advice - Apollo or Relay Modern for GraphQL?

At a crossroads in my project where I need to decide which way to venture forward with my front end API. I am using a Django-GraphQL back end and so far a React front end. I chose React because I am new to this style of app development and React…
David Morin
  • 397
  • 5
  • 25
2
votes
1 answer

Graphql: Typescript + Jest + Relay + Jest Can't seem to integrate together

I'm testing my React application built with Typescript and Relay. When I try to test relay powered component I am getting following errors: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this…
Ejaz Karim
  • 3,676
  • 6
  • 36
  • 49
2
votes
0 answers

Can Relay's RefetchContainer update sibling components with a refetch?

Is it possible to update the props of a component by calling refetch from a sibling component? Consider components with the following structure: # wrapped in a QueryRenderer # wrapped in a Fragment Container # wrapped…
jackweath
  • 158
  • 1
  • 8
2
votes
1 answer

Why is an updater/update function required to update the local cache in React Relay and Apollo Client?

I am considering using React Relay or the Apollo Client. I like the idea of GraphQL as a query language that can be executed against any API or data store. However, I am surprised by the need to manually (and imperatively) update the store/cache…
Corey Quillen
  • 1,566
  • 4
  • 24
  • 52
2
votes
3 answers

React/Relay Modern/GraphQL Simple Project Setup with Babel Issues

I followed the Relay tutorial for getting started after doing the create-react-app to get a new react up and running. I ran it both in TypeScript mode (from here: https://github.com/Microsoft/TypeScript-React-Starter) and also in the normal…
pinguinos
  • 123
  • 12
2
votes
1 answer

AddMutation using relay modern graphql

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:…
Beckham_Vinoth
  • 701
  • 2
  • 13
  • 39
2
votes
1 answer

Found Router (for Relay Modern) Protected auth route

I'm trying to create a protected route that will redirect to /login when user is not authorized using Found Router for Relay Modern based off the example given by React Router: const PrivateRoute = ({ component: Component, ...rest }) => { return…
jordancooperman
  • 1,931
  • 2
  • 21
  • 33
2
votes
1 answer

How to get the QueryRenderer to propagate parent prop changes?

Using Relay Modern v.1.4.1, consider the following List component. It takes two props foo and bar and renders a Table component with these props and the result of the GraphQL query: class List extends React.Component { constructor(props) { …
ZeroMax
  • 369
  • 4
  • 13
2
votes
1 answer

Relay Modern nested pagination

I have a root query of songs, this is in a pagination container. I then have a nested property on songs called comments that I also want to be paginated because I don't want to load 10k comments for each song all at once. songsContainer.js: fragment…
Martin Dawson
  • 7,455
  • 6
  • 49
  • 92
1 2
3
9 10