-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to multiple schema.json #130
Comments
Can you elaborate more on why you need multiple schemas? GraphQL is designed to support multiple backends within the same schema. Unfortunately, Relay currently does not support multiple schemas in one application. However, it maybe possible in the future as we support data from multiple sources (see #114) |
When dealing with bigger application, we may need to group schema based on module requirement, the schema.js file may be big and messy when handle bigger application if we can't group it. it will make thing hard to maintain as well. Just like when we are doing MVC, we can have many M. |
It's natural to split your schema definition into multiple files. However, you'll still have one file that imports all these type definitions and defines the root and mutation types. |
Wouldn't it take too much memory / space, if we keep importing those schema that we don't need at certain point of time? |
It won't! You see, from the perspective of the client code, the On the server side, a larger schema will take up more memory on your server, but as compared to other parts of your app, you should be able to let that schema file grow as large as you like without consequences. We recommend having one schema that describes your entire data universe. Relay will use only the parts of that query it needs to compile client code, and will generate requests to your |
Is React Relay suitable to build medium to large size application using React+Relay? |
Relay is in use in Facebook's Groups and Mobile Ads Manager apps, as well as a number of products currently under development. It's working well for us, and we hope that it works just as well for you! If you have any more questions about using a GraphQL schema with Relay, feel free to reopen this issue, or open a new one on a new topic. |
If we are building a bigger application where we have several module, we may be defining a few schema, and hence has multiple schema.json files.
How can we make sure all these schemas are properly loaded?
The text was updated successfully, but these errors were encountered: