Skip to content
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

Support custom GraphQLType name generation logic #3240

Open
DLillard0 opened this issue Jan 9, 2025 · 5 comments
Open

Support custom GraphQLType name generation logic #3240

DLillard0 opened this issue Jan 9, 2025 · 5 comments

Comments

@DLillard0
Copy link
Contributor

Currently, the graphql file type names generated by tailcall gen are too long. I noticed that the generation logic should be this part of the code. Currently, I manually modified this part of the code to support the type name rules I want to generate. Is there any way to provide a custom naming logic configuration to the outside world?

If you have a better idea to implement this function, I can also help develop this function.

@ssddOnTop
Copy link
Member

@DLillard0 Currently, we don't allow custom modifications to the generated names.

However, we can introduce JS support for converting names. A user can define a function that takes a string and returns a string.

@DLillard0
Copy link
Contributor Author

DLillard0 commented Jan 9, 2025

@ssddOnTop At which stage does this conversion occur? Based on my understanding, custom conversion logic should also require information such as GraphQL type, namespace.

@ssddOnTop
Copy link
Member

@DLillard0 we could give users an option b/w AI generated names or JS names or both

I am not sure if we need it.

We should wait for a reply from @tusharmath

@tusharmath
Copy link
Contributor

@DLillard0
Copy link
Contributor Author

@tusharmath This might not quite meet my needs. I need the generated names to be predictable, as I manage proto files and will handle the naming in those proto files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants