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

Update generator functions to make it easier to interop with other targets like ReScript #468

Open
dkirchhof opened this issue Oct 25, 2022 · 1 comment

Comments

@dkirchhof
Copy link

Hello,

I would like to build a custom generator for ReScript. More precisely a queries generator.
So I started to play with the $.analyzeQuery function. Unfortunately it returns the args and result type as a stringified TypeScript type. Would be nice if the function could return for example the fields property of the inCodec and outCodec.

Another "pain point" is that I have to duplicate a lot of code. For example how to read the config, how to get alle query files etc.
So a great addition again if the generateQueryFiles function could be more reusable.

Well, after realizing theses two issues I wanted to try out the "native" generator with a custom target. So I added some the new extension, changed the "impl" function, etc. Unfortunately there will be the walkCodec function again and all the codec stuff.

TLDR;
I just want to change (without a lot of effort) how the EdgeDB types will be mapped to the "targeted" output types.

Cheers,
Daniel

@scotttrinh
Copy link
Collaborator

@dkirchhof

I'm an erstwhile ReScript developer myself, so I'm open to making it easier for that ecosystem to integrate with EdgeDB. I'll throw this on my "medium-term" list of pet projects. I'm happy to help review PRs if you end up digging into this sooner than I get to it.

@scotttrinh scotttrinh changed the title custom generator / target for ReScript Update generator functions to make it easier to interop with other targets like ReScript May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants