Skip to content

Commit

Permalink
ensure schema is present before codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Jan 25, 2024
1 parent 1d44bc1 commit 18ba10d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/small-dingos-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fuse': patch
---

Bootstrap schema before codegen starts
8 changes: 7 additions & 1 deletion packages/core/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,13 @@ prog

if (opts.client) {
if (!isUsingTada) {
await boostrapCodegen(opts.schema, true)
setTimeout(() => {
fetch(
`http://localhost:${opts.port}/api/graphql?query={__typename}`,
).then(() => {
boostrapCodegen(opts.schema, true)
})
}, 1000)
} else {
setTimeout(() => {
fetch(`http://localhost:${opts.port}/api/graphql?query={__typename}`)
Expand Down

0 comments on commit 18ba10d

Please sign in to comment.