Questions tagged [react-relay]

Relay is a JavaScript framework for building data-driven React applications.

91 questions
0
votes
2 answers

Relay ConnectionHandler.getConnectionID() connection does not exist error

I'm trying to cleanup relay graphql flow in my app. Atm in some places I'm still using fetchKey and record invalidation, which I'd like to change to @appendEdge/@appendNode directives. Unfortunately every time I'm trying to get the proper connection…
user11569827
  • 165
  • 1
  • 9
0
votes
1 answer

GraphQL Relay introspection query fails: Unknown field '__type' on type 'Query'

I have a React application with a GraphQL client (Relay). I need to make an introspection query to get all the types of a certain enum. This is my query: import { graphql } from 'react-relay' export const corporationTypeEnumQuery = graphql` query…
Arnold Gee
  • 856
  • 2
  • 8
  • 18
0
votes
0 answers

Subscription on relay graphql query for chat utility

I'm trying to create a chat using relay graphql and react-native-gifted-chat. The problem I have is refreshing the query with each message both from me and other participants. The query already includes pagination, but I don't really know how to…
0
votes
0 answers

infinite scroll relay modern (v11) using the pagination container and loadMore

Using react 17 and relay-modern 11 I want to build a list, with which, when one reaches the end, they can click a button that says load more and it adds more entries to the list. Here is what I have so far. The rows are name and cursor see I should…
Joey Gough
  • 2,753
  • 2
  • 21
  • 42
0
votes
1 answer

resetting a pagination to refetch on default variables on pull to refresh throw cursor warning?

i have this props on my flatlist: onRefresh={() => { setIsRefreshing(true); refetch( { categoriesCount: 4, categoriesCursor: '' }, { fetchPolicy: 'network-only', onComplete: ()…
gpbaculio
  • 5,693
  • 13
  • 60
  • 102
0
votes
1 answer

Cannot read property 'createKeywordTypeNode' of undefined

I have a react typescript application which uses GraphQl. Everything was working fine till yesterday But now I am receiving a weird bug while executing the command "yarn run relay && react-scripts start" "relay": "relay-compiler --src ./src…
0
votes
1 answer

GraphQL / Relay - do all tables need to be queried in main QueryRenderer?

I'm new to GraphQL and Relay and I'm struggling with queries, fragments, ...spreads & passing props. I think I'm unnecessarily passing props down through many, many components. I want to learn how to teleport my data objects from the QueryRenderer…
Kirk Ross
  • 6,413
  • 13
  • 61
  • 104
0
votes
1 answer

Relay Pagination - Remove old nodes from store after cursor changed

I implemented pagination system by using pagination container. It works great with one problem. When i call loadMore function to get new nodes relay fetches nodes from server and adds to olds ones. But i want to delete old nodes and just want to…
Taha Ergun
  • 566
  • 2
  • 7
  • 17
0
votes
1 answer

how to pass initial variables to createPaginationContainer

i'm trying to use createPaginationContainer with some variables, here is example of my code: export const GiftRecipientsPaginationContainer = createPaginationContainer( GiftRecipients, { giftRecipientsMe: graphql` fragment…
Marcin
  • 510
  • 6
  • 22
0
votes
1 answer

Do I need to always pull the id field when using react relay

I am curious if I have to always include the id field when making queries to a relay graph QL server? For example: users_connection { edges { node { id userId firstName } } } I sometime use the id field…
Charklewis
  • 4,427
  • 4
  • 31
  • 69
0
votes
1 answer

Can relay fragment arguments be composed different from argument definition?

I have the following fragment definition fragment LocationFragment_viewer on Viewer @argumentDefinitions(userId: {type: "Int!"}) { results: locations( user_id: $userId ) { ...some_other_fragments } } I want to change…
HeyThere
  • 503
  • 1
  • 5
  • 19
0
votes
1 answer

react-relay delete mutation update

I can't find out how to update table after deleting row. Apollo-server is used in backend and relay for client. I'm trying to use NODE_DELETE but I don't know what I'm doing wrong this is delete mutation const mutation = graphql` mutation…
Reza Sam
  • 1,264
  • 2
  • 14
  • 29
0
votes
1 answer

React Relay createFragmentContainer and QueryRenderer data flow

I've been working through the examples in relay's document for QueryRenderer https://relay.dev/docs/en/query-renderer and FragmentContainer https://relay.dev/docs/en/fragment-container I'm confused as to how the data is meant to be accessed by the…
NULL pointer
  • 1,116
  • 1
  • 14
  • 27
0
votes
0 answers

How to define graphql query in schema with exactly one of two parameters required

I have a graphQL ApolloServer returning a paginated set of Transaction(s) for an Account. Here is a snippet of my schema: type Account implements Node { id: ID! name: String! } type Transaction implements Node { id: ID! name: String! …
NULL pointer
  • 1,116
  • 1
  • 14
  • 27
0
votes
1 answer

How to use GrahpiQL to upload file in grahpql?

I am a newbie in graphql and I am trying to create a sever which will take few parameters and a few files (like images) as parameters in mutation. I am using graphql-yoga and it is very clear how to implement it using graphql-yoga. My question is…
dash
  • 89
  • 1
  • 8