-
Notifications
You must be signed in to change notification settings - Fork 49
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
Feat: Customized Prefixing #23
Conversation
feat: add `scalars` config option for custom GraphQL [scalar -> casual] mappings
…xing # Conflicts: # src/index.ts # tests/typescript-mock-data.spec.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice thanks
For the scalar
, I totally agree, but for the prefix I was thinking of using indefinite package instead, so we have proper a
vs an
prefix.
Would that fix your problems?
It would yeah, although I feel that the PR is just related to the bug itself, but to a new feature as well. In any case, I'm fully ok if you don't want to merge this due to the fact that it might make things more complex |
Well it seems like this PR includes the scalar changes as well, I think you have an issue with your branches. |
Yeah you are right. I wanted to experiment a bit and I made a wrong merge. I'll clean all this up and start over |
Closing in favor of #25 |
This PR simply provides an option for users to specify the prefix that their mock builders will have.
Closes #22
Additional Context
Initially I tried to implement the
addPrefix
option, but I saw that when omitting the prefix, the generator function names collided with the name of the existing TS types from@graphql-codegen/typescript
. That's why a prefix must always be present.This PR makes sure to fallback to the default prefix implementation even if the user manually specifies
''
as a prefix just for this reason alone