Questions tagged [relaymodern]

145 questions
1
vote
2 answers

how to pass filter arguments to relay loadMore

I am trying to filter and paginate a connection with Relay modern and a pagination container. This works fine, but the filter is not transmitted when loadMore() is triggerred on a filtered connection. Here is my submit search form code in my React…
user2172221
  • 21
  • 1
  • 3
1
vote
0 answers

Trying to create a more dynamic/reusable root level QueryRenderer

I've been working on implementing a generic which serves as the single source of truth from the root level, ultimately branching off into multiple fragments. My initial implementation statically defined fragments within the query…
Scot Matson
  • 745
  • 6
  • 23
1
vote
3 answers

How to capture the GraphQL error message in Relay?

On my server, my implementation of GraphQL is using Flask, Graphene, and SQLAlchemy. Ideally I would like to be able to simply manipulate the headers and return a 401 error response, but GraphQL returns everything as 200. Using flask.abort(401)…
Scot Matson
  • 745
  • 6
  • 23
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

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

Access PreloadedQuery's queryRef in a grandchild without passing down props

I am using Relay modern and I have preloaded query and I want to call the usePreloadedQuery hook in a grandchild/great-grandchild of the component where the query is initially loaded. In the documentation they are passing down the queryReference…
avocado
  • 79
  • 9
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
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

Relay Modern BadRequestError: Missing multipart field ‘operations’

I am trying to upload file to my server. using Altair i can do it without any error but when i use Relay.js for uploading it server throws following error. BadRequestError: Missing multipart field ‘operations’…
Rekha
  • 21
  • 2
0
votes
0 answers

How to use react component with its own graphql fragment when the api returns an array?

If I have a simple UI component that displays some some product info. And it contains it's own fragment like so: const Product = ({detail}) => { const data = useFragment( graphql` fragment Product_detail on Product { …
davidx1
  • 3,525
  • 9
  • 38
  • 65
0
votes
1 answer

Relay Modern updater ConnectionHandler.getConnection() returns undefined when parent record is root

Debugging update: So, we went a bit further in debugging this and it seems like 'client:root' cannot access the connection at all by itself. To debug the complete store, we added this line in the updater function after exporting the store variable…
e.g-m
  • 36
  • 6
0
votes
1 answer

When making a node query, will react-relay check if that node is in the store before making a network request?

If I create a graphql server that has the following schema: type Node { id: ID! } type User implements Node { id: ID! groups: [group!]! } type Group implements Node { id: ID! name: String! } type Query { me: User! node(id: ID!):…
0
votes
1 answer

Sort connection in relay modern store client side

I have a mutation that reorders two edges in a relay connection. What is the right way to perform this reordering optimistically? I've tried an in-place sort like: const conn = ConnectionHandler.getConnection(pathway, 'PathwayGraph_actions'); const…
Rob Allsopp
  • 3,309
  • 5
  • 34
  • 53
0
votes
1 answer

How do I combine both environments for Relay Modern?

There's an example of injecting NetworkLayer with middlewares on the client side for Relay Modern that includes the following lines: const network = new RelayNetworkLayer([...]) On the other hand, my current setup were taken from here and include…
A. Karnaval
  • 727
  • 2
  • 8
  • 12
0
votes
1 answer

How to pass Today's Date as default value createFragmentContainer in argumentDefinitions

I am using Relay Modern (V 1.7.0). We have requirement where we need to send today's date to our GraphQL API export default createFragmentContainer( UpcomingCampaigns, { Viewer: graphql` fragment UpcomingCampaigns_Viewer on Viewer …
jvm
  • 1,662
  • 8
  • 27
  • 46