Questions tagged [relaymodern]

145 questions
4
votes
2 answers

Load data from relay store while the query is loading

I have a common Header and Footer that displays data that it may be already in the relay store and the main PageComponent that expects data from the “query”, but I don’t want to display a full loading screen to the user, I want to display the…
Chris
  • 333
  • 1
  • 7
4
votes
1 answer

Error when trying to unmask relay modern fragment that has arguments

I've got the following query: query ChatRefetchContainerRefetchQuery( $arg: ID! $arg2: Boolean! ) { ...PeopleFragment @arguments(arg: $arg, arg2: $arg2) } What I want todo is unmask the ContainerFragment data OUTSIDE of the fragment.…
James111
  • 15,378
  • 15
  • 78
  • 121
4
votes
1 answer

Implement multiple interfaces in graphql

I am using the relay compiler and it is not letting me compile a schema with a type that implements multiple interfaces. I made a small test project: package.json { "scripts": { "relay": "relay-compiler --src ./ --schema schema.graphqls" }, …
Piotr
  • 4,813
  • 7
  • 35
  • 46
4
votes
0 answers

Relay modern: refetch doesn't update props

I'm trying to use createRefetchContainer of the Relay Modern. but the props aren't passed down to my component from the result of the refetch query. The refetch query runs okay and the response will come back from the server, but the ui doesn't get…
Mani Shooshtari
  • 760
  • 1
  • 6
  • 19
4
votes
2 answers

React Relay Modern redirecting to another page when receiving 401 error on network environment

I´m using JWT authentication inside my ReactJS RelayJS network environment. All the token retrieval and processing in server and client are fine. I´m using react router v4 for routing. My problem is when I receive a Unauthorized message from server…
Mendes
  • 17,489
  • 35
  • 150
  • 263
4
votes
0 answers

how to pass dynamic arguments in Relay modern?

I have specific requirement in Relay-Modern to pass current date as arguments. From which i understand it's not possible in Relay-Modern as we can not write any code in initialVariables(was part of Relay Classic Api) as this step is now shifted to…
Anil Sharma
  • 275
  • 1
  • 6
  • 16
4
votes
2 answers

Relay Modern, prop not supplied

I'm getting data returned from my server correctly, but I'm getting a prop not supplied error. ~ expected prop `query` to be supplied to `Relay(ContactsPage)`, but got `undefined`. With the following. import makeRouteConfig from…
Tim
  • 4,471
  • 5
  • 36
  • 42
4
votes
1 answer

Relay container with no data

I'm building an app as my first real foray into React, Relay and GraphQL, using Relay Modern. The basic case is, I have a login form component that doesn't really need any data; that is to say, the component renders a form, and has a corresponding…
metahamza
  • 1,405
  • 10
  • 26
4
votes
2 answers

How to do file uploads with Relay Modern mutations?

I'm using react-relay/compat 1.1.0 and I need to write a mutation with the ability to upload a file. In Relay Classic you can use getFiles() to support file uploads in mutations: class AddImageMutation extends Relay.Mutation { getMutation() { …
Maikel Ruiz
  • 1,342
  • 2
  • 15
  • 25
4
votes
1 answer

Relay Modern node does not contain fragment properties

I have the following setup in my React Project: export default class OverviewScreen extends React.Component { public render() { return (
Jonathan
  • 516
  • 5
  • 20
4
votes
2 answers

Relay Modern purpose of createFragmentContainer

I've been trying relay-modern for some time, and I'm wondering what are the purposes of createFragmentContainer other than just for describing the fragment that should beloing to the Component. e.g. this is how documentation show how it is supposed…
andiwin
  • 1,552
  • 3
  • 14
  • 27
3
votes
1 answer

How can I have multiple sibling instances of the same top level fragment container?

I am following this guide: https://relay.dev/docs/en/quick-start-guide#composing-fragments I am trying to create a higher level fragment container that queries data from the RootQuery: export const FormInstanceListContainer: FunctionComponent
Hubro
  • 56,214
  • 69
  • 228
  • 381
3
votes
1 answer

Relay compiler does generate auto generated files

here is my schema.graphql schema { query: RootQuery } type RootQuery { student(id: String): Student students: [Student] school(id: String): School } type School { id: String name: String address: String students: [Student] } type Student { id:…
3
votes
0 answers

Relay: When refetch container is called clears different fragment container

I have two containers on the Query level like so: query home_Query { ...AppQuery ...RefetchQuery } The refetch() gets called when the component is mounted, and it triggers a refresh on the AppQuery. However, when that rerender happens,…
jouerai
  • 135
  • 9
3
votes
1 answer

UI not reflecting changes after mutation

I am using a QueryRenderer to populate an edit form in my application. The data is also being displayed in additional DOM elements throughout the page. I am then saving the values back on form submit through a mutation. Everything works great,…
Sloth Armstrong
  • 1,066
  • 2
  • 19
  • 39
1
2
3
9 10