Relay is a JavaScript framework for building data-driven React applications.
Questions tagged [react-relay]
91 questions
1
vote
1 answer
Use result of Relay Mutation as a Relay Container Prop
The flow I'm trying to achieve is
User clicks a button "Create X"
create a blank X using a relay mutation
open a modal to edit X
I have a server side mutation which returns x (of type X), its parent, and the edge between them so I can do a…

Tyler Sebastian
- 9,067
- 6
- 39
- 62
1
vote
1 answer
React Relay (react-relay) with Typescript throwing TypeError: Object prototype may only be an Object or null: undefined
I'm running into an really bizarre TypeError with react-relay when trying to instantiate a class that extends Relay.Mutation. I've created a simple Typescript project with create-react-app my-app --scripts-version=react-scripts-ts to demonstrate the…

Justin Levi Winter
- 2,327
- 2
- 17
- 30
1
vote
1 answer
React relay disk cache
I've got react native application with GraphQL API where is usage react-relay library. And I need to implement disk cache to the application, I see that request are caching already in runtime, but after reload application the request again reload…

Lim Kim
- 21
- 1
- 4
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
0
votes
0 answers
How do I avoid nulls in array after delete mutation with React Relay?
Using react-relay v15.
I have a component that gets a list of orders.
const data = useLazyLoadQuery(OrdersQuery, {});
I have another component that can delete orders via a mutation.
mutation DeleteOrderMutation($orderId: ID!) {
…

michaelmsm89
- 475
- 7
- 20
0
votes
0 answers
How to correctly use useSubscription and updater with a usePaginationFragment (with connection)
I am trying to implement a subscription on a paginated fragment, that contains edges, with a specified connection inside of the relay store (using the updater variable provided in useSubscription). The paginated query fragment itself is working as…

Adam Jones
- 1
- 1
0
votes
0 answers
How to handle coupon-verification with Relay
I'm having trouble with a seemingly trivial use-case:
Assume there is a large checkout page with a 'coupon' field and an 'apply' button next to it. The user enters a coupon code and presses 'apply' expecting the coupon code to be applied to his…

AscendingEagle
- 771
- 1
- 7
- 17
0
votes
0 answers
Unable to create Relay Container. The value of fragment `kind` was expected to be a fragment, got `Fragment` instead
I'm trying to get a demo running using relay for the first time. I have my Relay compiler running ok and my relay graphql files generating, but when I run the application I get the following error:
Uncaught Invariant Violation: Could not create…

Stewart Alan
- 1,521
- 5
- 23
- 45
0
votes
1 answer
Relay compiler failing to read graphQL file
I am trying to get Relay up and running for the first time and have followed the set up guide at https://relay.dev/docs/getting-started/step-by-step-guide/
I have got as far as generating my graphQL file, configuring Relay and now want to run the…

Stewart Alan
- 1,521
- 5
- 23
- 45
0
votes
0 answers
Why does Relay set omitted optional variables to null?
When I execute a mutation created by useMutation with react-relay, and do not explicitly set optional variables, Relay sets those optional variables to null in the request.
My GraphQL server (Apollo) is able to distinguish between undefined and null…

Julian Haluska
- 75
- 1
- 8
0
votes
1 answer
how to not fetch fragment data until component renders react GraphQL
I thought that relay modern implemented a system whereby it would not try to fetch data until it was rendering the component that declared it. I am talking about fragment components. I have tried to test this but it is fetching all the data.
import…

Joey Gough
- 2,753
- 2
- 21
- 42
0
votes
1 answer
Relay with hook useMutation get error: Invalid hook call. Hooks can only be called inside of the body of a function component
thanks for your reading. I'm trying to commit a relay mutation of using the useMutation hook, but got the error:
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the…

yuner
- 1
0
votes
1 answer
Reactnative Signalwire application unable to establish Ice server peer connection
I am trying to implement Signalwire calling in a react-native app. I am facing issue in connecting ice servers. Sometimes it connects and calling between two persons get successful. But most of the time it throws error
"Cannot set properties of…

Saira Nawaz
- 710
- 2
- 10
- 24
0
votes
1 answer
React relay with NextJS: RelayContext: Expected `context.relay` to be an object conforming to the `RelayContext` interface, got `[object Object]`
I have setup my Relay environment like this:
// createRelayEnvironment.ts
let relayEnvironment
export default function initEnvironment({ records }: EnvProps) {
// Create a network layer from the fetch function
const network =…

MDalt
- 1,681
- 2
- 24
- 46
0
votes
1 answer
'ENOTDIR' error while running relay-compiler with yarn
I am trying to make an application with react-relay following the step-by-step guide on the relay documentation. After running yarn install and adding the yarn relay script which runs "relay-compiler --src ./src --schema ./schema.graphql --language…

Qian-Ye_Lin
- 11
- 3