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 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
The text was updated successfully, but these errors were encountered:
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
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
Hello,
I would like to build a custom generator for
ReScript
. More precisely aqueries generator
.So I started to play with the
$.analyzeQuery
function. Unfortunately it returns theargs
andresult
type as a stringified TypeScript type. Would be nice if the function could return for example thefields
property of theinCodec
andoutCodec
.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 thewalkCodec
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
The text was updated successfully, but these errors were encountered: