StellateHQ / fuse

Fuse: The fastest way to build and query great APIs with TypeScript

Home Page:https://fusedata.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discussion: Export-based API instead of builder.xyz

mxstbr opened this issue · comments

I have the strong opinion that this is the much better API, as it more closely aligns with the common frontend mental model that Next.js's routes & API routes have:

export const LaunchNode = node({}) # See #3 and #4

export const queries: Queries = (t) => ({})

export const mutations: Mutations = (t) => ({})

Jovi in Slack:

Export API can't work without Next helping us 😅 and honestly pothos bugs out very frequently with it

I mean, my point more so being that without us having a good way to plug into Next and create our own compiler we won't be able to use the exports. I had it working in the normal fuse CLI but for Next where everything is running independent of you that won't do. For exports you need a metaprocess that compiles on the fly and calls the pothos builder with the attained value

Closing this out for now as we settled on our middle ground solution