isographlabs / isograph

The UI framework for teams that move fast — without breaking things.
MIT License
245 stars 16 forks source link

Bug: entrypoints and resolvers cannot exist in same file #151

Open rbalicki2 opened 1 month ago

rbalicki2 commented 1 month ago
PatrykWalach commented 1 month ago

This also might be related to how the code is transformed with vite-plugin-commonjs

export const Field = iso(`field Query.Field ...`)

iso(`entrypoint Query.Field`)

->

export const Field = ...

require(`__isographq/Query/Field/entrypoint.ts`)

->

import __foo from "__isographq/Query/Field/entrypoint.ts"
export const Field = ...

__foo

if import was inserted in different order then resolver possibly wouldn't be undefined

export const Field = ...

import __foo from "__isographq/Query/Field/entrypoint.ts"
__foo