Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
58
rated 0 times [  61] [ 3]  / answers: 1 / hits: 16230  / 6 Years ago, wed, july 11, 2018, 12:00:00

What is the best way to structure a graphQL project/server side?
this is my current structure




  • src

  • config


  • models


  • setup

  • schema


    • queries


      • index

      • userQuery


    • resolvers


      • index

      • userResolver


    • types


      • index

      • userType




More From » node.js

 Answers
38

I don't think there is the best way to structure a GraphQL server. Your seems fine!



Check this GraphQL APIs repo that contains several examples and repositories with many different implementations.



In my TypeScript projects I usually use a structure like this:



src/
├── user/
│ ├── data.ts
│ ├── mutation.ts
│ ├── query.ts
│ └── type.ts
├── bananas/
│ ├── data.ts
│ ├── mutation.ts
│ ├── query.ts
│ └── type.ts
├── utils/
│ ├── database.ts
│ └── config.ts
├── index.ts
└── schema.ts

[#54006] Saturday, July 7, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lindsay

Total Points: 402
Total Questions: 109
Total Answers: 109

Location: Tuvalu
Member since Sat, Feb 11, 2023
1 Year ago
;