-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixing init dataconnect on some empty schema cases #8051
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- Changes default CF3 runtime to nodejs22 (#8037) | ||
- Fixed an issue where `--import` would error for the Data Connect emulator if `dataDir` was also set. | ||
- Fixed an issue where `firebase init dataconnect` errored when importing a schema with no GQL files. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { join, basename } from "path"; | ||
import * as clc from "colorette"; | ||
import * as fs from "fs-extra"; | ||
|
||
import { confirm, promptOnce } from "../../../prompt"; | ||
import { Config } from "../../../config"; | ||
|
@@ -196,7 +197,11 @@ async function writeFiles(config: Config, info: RequiredInfo) { | |
for (const f of info.schemaGql) { | ||
await config.askWriteProjectFile(join(dir, "schema", f.path), f.content); | ||
} | ||
} else { | ||
// Even if the schema is empty, lets give them an empty .gql file to get started. | ||
fs.ensureFileSync(join(dir, "schema", "schema.gql")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it's worth also filling in that schema with the commented out schema? I could go either way There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a little safer in case they already had a schema.gql file - ensure won't overwrite it |
||
} | ||
|
||
for (const c of info.connectors) { | ||
await writeConnectorFiles(config, c); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change required, but this could've been optional, and you wouldn't have to change any of the existing test-cases