Thanks for sharing! While throwing everything in a single schema.js file is a great way to get started, it's true that it becomes unwieldy as the schema grows. You example definitely goes a long way towards imposing order.
Have you tried discussing this with other people on the Slack channel? I expect that others are probably exploring this question just like you are, and it would be interesting to share opinions.
@wincent I did not discuss this on the Slack, but it's good idea. Thank you.
I found this quite natural: https://github.com/mrblueblue/graphql-express-sqlite/tree/master/schema
@sulliwane what if you have more complex schema?
I'm satisfied with this:

I call schema with require('./schema').
For example you have next query, which can grow up in future. Will you write all queries in one query file?
query {
viewer {
users (first: 10) {
name,
address {
street,
building,
neighbors {
firstName,
lastName
}
}
}
}
}
@mikhail-riabokon I create a file for each query that queries the database.
@xpepermint your variant is better than mine. Thank you. But I use not only one file for queries.
-- mutations
----- .......
-- types
----- ....
-- queries
----- root.js
----- queries
--------- queryField
------------ index.js
------------ ....
--------- ......
It make's queries more structured, and it's really help me with "queries mess".
I've updated an example for better understanding.
Sorry for my misunderstanding, is there a question or issue raised here? I'm not sure what you would like from me or this repo.
My personal opinion is that splitting large schema up across many files is a good idea and something I would encourage.
The reason the example in this repo builds a schema in a single file is because it is quite small and I wanted to keep the example simple.
@leebyron Actually I have asked about folder structure because it's hard to keep everything in one file. That's why we have discussed that, and @xpepermint gave good example and I have updated my, with more than "one level" of queries. So for now, I think this question can be closed, if you do not have any suggestions. Thank you.
Okay great.
@xpepermint hello how do you do to join the queries in a single object "GraphQLObjectType"
@ahelord Just use the usual require commands and make sure you set fields: () => ({}) (a method that returns fields object).
@xpepermint I'm sorry, do not ask well.
How do you assemble all the graphql query files in another file to parse the object GraphQLObjectType
@mykhailo-riabokon hi
you could have this project
https://github.com/mykhailo-riabokon/express_graphql_folder_structure
run with Express
Most helpful comment
I'm satisfied with this:

I call schema with
require('./schema').