Questions tagged [relaymodern]
145 questions
2
votes
0 answers
ag-Grid infinite scrolling with Relay Modern
I'd like to implement infinite scrolling using ag-Grid's getRows function.
This function calls a successCallback when data has been fetched from the server. I'm using Relay Modern and they expose a loadMore function to fetch additional items from…

AranS
- 1,871
- 10
- 22
2
votes
1 answer
Handling local data in Relay Modern
I'm stuck with passing data returned from a mutation to handle form validation in Reactjs. This pattern is not limited to only form validation but to other components which share similar requirements where something is mutated/queried and the…

Ante Gulin
- 2,022
- 2
- 15
- 16
2
votes
2 answers
Is it possible to unlink a linked record using the Relay Modern imperative mutation API?
I would like write a mutation updater that unlinks a linked record from another record.
For example, suppose I have the following in my store:
client:root {
user: {__ref: "someid"}
}
I am looking for a way to unlink user and client:root. user is…

Dmitry Minkovsky
- 36,185
- 26
- 116
- 160
2
votes
1 answer
Why are Relay Modern QueryRenderer render props undefined?
This is my first attempt at using Relay Modern.
Fetching for a specific User from a PostgraphQL GraphQL Server.
It is fetching the data successfully but not passing to render function:
import {createFragmentContainer, QueryRenderer, graphql} from…

Ashley Aitken
- 2,419
- 2
- 20
- 24
2
votes
1 answer
Relay Modern Mutations, RANGE_ADD / Append
I have a collection and a mutation to add a new item to it. I haven't been able to get Relay Modern to update the UI after a successful mutation.
I've got a PaginationContainer setup with the following query: prop
{
query: graphql`
…

Tim
- 4,471
- 5
- 36
- 42
2
votes
2 answers
How to pass custom props into QueryRenderer render function?
Given the following QueryRenderer component:
class ProjectQueryRenderer extends Component {
constructor(props) {
super(props);
this.renderProjectList = this.renderProjectList.bind(this);
}
renderProjectList({ error, props }) {
if…

nickdecooman
- 153
- 11
2
votes
0 answers
Relay Modern refetch does not pass new data
I am quite new to Relay Modern so I may be doing something wrong here. Also I'm having a hard time finding documentation on how this should be done.
I have an app which presents a virtual directory structure view built in React with the following…

Robin Elvin
- 1,207
- 12
- 28
2
votes
0 answers
Extending relay-compiler to emit TypeScript definitions
I understand there are extensibility points for modifying the relay-compiler output (https://facebook.github.io/relay/docs/relay-compiler.html#advanced-usage). I'd like to explore creating TypeScript definitions instead of Flow type, but I'm having…

Tony D
- 266
- 2
- 15
2
votes
0 answers
What's the role of the `query` that's passed to `createPaginationContainer` in Relay Modern?
I've got a question about the PaginationContainer API in Relay Modern.
When using createPaginationContainer, we're passing it a configuration object that also contains a query (as is the case in the official example).
I was wondering why we have to…

nburk
- 22,409
- 18
- 87
- 132
2
votes
0 answers
Relay Modern and Join Monster
After reading Sashko Stubailo's post "Exploring Relay Modern" it seems apparent that one of the more important enhancements of Relay Modern is the query compiler. The compiled queries remove duplicate references and can be stored on the server and…

Gardner Bickford
- 1,934
- 1
- 17
- 25
1
vote
0 answers
Passing Int arguments to mutations relay and typescript
I am using a schema first approach have the following Input type for a mutation
input VerifyBankAccountInput {
bankAccountId: ID!
amount1Cents: Int!
amount2Cents: Int!
}
On the frontend I am using relay with typescript. In the generated…

avocado
- 79
- 9
1
vote
1 answer
How to force refetch the entire node in Relay?
Suppose that we have this mutation:
const [addCryptoAddress] =
useMutation(graphql`
mutation useCrypto_AddCryptoWalletAddressMutation(
$input: AddCryptoAddressInput!
) {
addCryptoAddress(input: $input) {
userAccount {
…

Gajus
- 69,002
- 70
- 275
- 438
1
vote
0 answers
Relay optional query with usePreloadedQuery
Let's say you have this use case:
A simple form with one input and a submit button.
When the input value is valid (>3 chars) you want to query the server to see if the value is already in use.
The button should be disabled when
A. input value is <4…

Malo Guertin
- 307
- 2
- 16
1
vote
1 answer
How do I remove a shared node from two different relay connections?
I'm working on standing up a simple Relay/GraphQL app using Node.
At the root level, I have a connection called 'notes' that paginates all notes in the database. On my user object, I have a notes connection that paginates all notes that user has…

danitheturtle
- 11
- 2
1
vote
1 answer
Catch errors from usePreloadedQuery
I have this code and I want to catch the errors that happens in the query used by usePaginationFragment.
what happens now is when something goes wrong in the backend, the data.queryName returns null, and there is no way to know about the errors.
the…

naoufal bardouni
- 241
- 3
- 11