You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a lot of .graphql files in my Angular project. When I use the code generation tool, it creates a very large file that contains all types and all Angular services in a single file. This is quite overwhelming.
I would like to have each .graphql file generate its own corresponding .ts file, while keeping all common types in a single common.ts file. This way, each Angular service will be in a separate file, and we can avoid duplication by placing shared types in one location.
For example, if I have x.graphql and y.graphql, I want the output to be x.ts, y.ts, and common.ts. For example, If both .graphql files query the student type, the type definition for student should be included in common.ts.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello Community,
I have a lot of .graphql files in my Angular project. When I use the code generation tool, it creates a very large file that contains all types and all Angular services in a single file. This is quite overwhelming.
I would like to have each .graphql file generate its own corresponding .ts file, while keeping all common types in a single common.ts file. This way, each Angular service will be in a separate file, and we can avoid duplication by placing shared types in one location.
For example, if I have x.graphql and y.graphql, I want the output to be x.ts, y.ts, and common.ts. For example, If both .graphql files query the student type, the type definition for student should be included in common.ts.
Here is my current configuration:
Beta Was this translation helpful? Give feedback.
All reactions