-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Add configuration to generate a client for a subset of the graph #1281
Comments
FYI, with the "CompileTime plugin", you can generate your client for any given |
Could yes if we control the original server. In this case though I have to build through introspection, because it is a server controlled by apollo |
https://www.apollographql.com/blog/announcement/backend/apollo-router-is-now-generally-available/ Apollo just went GA with their router tool which is basically an ultra efficient reimplementation of apollo-server in rust. One thing we are looking at doing is creating an internal federation graph of all of our internal services so that we don't have 20 different clients. If we do having this would probably be a must to avoid having to generate 4k classes to use a single mutation. |
Currently client generation occurs for the entire graph, that is, when you generate from a schema you will end up with generated files for the entire schema regardless of if it is useful to you. I encountered this in #1280 when generating the client, the full schema contains about 500 types, since we only needed the types related to the
reportSchema
mutation this was overkill (and it prevents us from automatically generating the schema through the plugin).We should allow the user to specify the names of top-level fields,
Mutation.reportSchema
for instance, and then perform a graph walk of the types that are used by that call to only resolve the types that are needed to satisfy those queries.The text was updated successfully, but these errors were encountered: