Reducing GraphQL schema size #4875
ikenox
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm using payloadcms for my current project, and it's a really helpful to develop our application rapidly.
However, I've faced a problem that the generated GraphQL schema is quite large.
I currently have only 10+ collections in my project, but the resulting GraphQL schema exceeds 20k+ lines.
Because of the large schema, it takes 5-10 minutes for auto-generating the our client code (flutter project). It also results in a large amount of generated code that consumes memory resource on editor.
Upon examining the schema, I noticed that it could potentially be reduced in size with a few simple adjustments.
For instance, for every unique String field, almost the same filter condition input types are defined.
Here is an example:
Using the same input type for filters of the same type seems likely to reduce the schema size.
In addition to this, it would be great to have an option that allows to exclude specific Queries and Mutations from the schema.
We do not plan to use queries like
docAccessXxx
that are generated for each collections, so excluding them would potentially lead to a significant reduction in schema size.I would appreciate any thoughts or feedback. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions