Closed achilsowa closed 3 years ago
relay-compiler doesn't look at either <QueryRenderer>
or <Route>
– it looks at the graphql
tags. Are you still using those?
Hi, and thanks for your prompt reply.
relay-compiler doesn't look at either
<QueryRenderer>
or<Route>
– it looks at thegraphql
tags. Are you still using those?
Yes I'am.
Here is the essential content of my HomePage.graphql.ts that define the Home page query used later in <Route \>
import graphql from "babel-plugin-relay/macro";
export default graphql
query Home_Query($first: Int, $after: String) {
...AnnounceList_data
}
AnnounceList_data
is a fragment created in createFragmentContainer
, and after compiling with relay-compiler
the file
./src/__generated__/typescript/AnnounceList_data.graphql.ts
is generated but not the file ./src/__generated__/typescript/Home_Query.graphql.ts
, which was generated before (when using <QueryRenderer />
)
Ah, I'm not really sure what's going on there, then. It's possible the plugin isn't correctly picking things up. Perhaps try inlining the graphql
tag definition with the <Route>
?
Hi @taion I tried to defined the graphql tag directly in the file it was used, and it was compiled. Thanks for your suggestions
Hi, I'm using create-react-app with typescript support I was looking for a static routing solution that I could use with relay modern, and I found found-relay (lol). Before using that, I was using a \<QueryRenderer \/> for final fetching of data to the server. With that queries and fragments type were generated in src/__generated__/typescript (my config folder in relay-compiler). Then I made some test with found-relay and tried to replace my \<QueryRenderer \/> with a makeConfigRoute like explained in the todomvc test code:
I may be wrong, but due to point 2, I think the issue may be on the found-relay side, specially because everything worked fine with \<QueryRenderer \/>. I looks like relay-compiler seems to know nothing about \<Route \/> like he did for \<QueryRenderer \/>
Is there possible to "tell" that to relay-compiler ? Thanks