DEV Community

Discussion on: Opinionated React: Folder Structure & File Naming

Collapse
 
anuraghazra profile image
Anurag Hazra

Hey great article, I wanted to ask you, how do you structure your graphql related files (client, queries, mutations, generated code)

Collapse
 
farazamiruddin profile image
faraz ahmad

I like to write my GraphQL queries and mutations in-line within the component file, since my queries are almost always 1:1 with the component that is using it. You can see this here: dev.to/farazamiruddin/an-opinionat...

As far as generated code, I keep a top level folder for all generated code and title it __generated__. All the auto-generated type definitions go in there.