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
The auto generated types for operation arguments can become very long due to automatic concatenation of all parent types.
I understand that the argument types need to be unique in order to avoid collision with other argument types, but the deeper the GraphQL schema is the longer the types are, and the code is becoming hard to read.
I couldn't find any option to control this behavior.
Is there a way to shorten the argument names, or provide custom ones during generation?
One solution, which I'm not so fond of, is to post process the generated files, identify long type names and replace them with shorter names. I'd rather let the generator do it. For example, if the name is over some threshold (e.g. 30 characters) then use a running number IF there are collisions with out similar types, in the short name form.
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
Uh oh!
There was an error while loading. Please reload this page.
-
The auto generated types for operation arguments can become very long due to automatic concatenation of all parent types.
I understand that the argument types need to be unique in order to avoid collision with other argument types, but the deeper the GraphQL schema is the longer the types are, and the code is becoming hard to read.
I couldn't find any option to control this behavior.
Is there a way to shorten the argument names, or provide custom ones during generation?
One solution, which I'm not so fond of, is to post process the generated files, identify long type names and replace them with shorter names. I'd rather let the generator do it. For example, if the name is over some threshold (e.g. 30 characters) then use a running number IF there are collisions with out similar types, in the short name form.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions