-
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
Conversation
} | ||
} else { | ||
// Even if the schema is empty, lets give them an emty .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 comment
The 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 comment
The 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
expectedSource: string; | ||
expectedFiles: string[]; | ||
expectCSQLProvisioning: boolean; | ||
expectEnsureSchemaGQL: boolean; |
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
Co-authored-by: Maneesh Tewani <maneesht@users.noreply.github.com>
* Fixing init dataconnect on some empty schema cases * Ensure schema.gql, not just dir, and add test * Update src/init/features/dataconnect/index.ts Co-authored-by: Maneesh Tewani <maneesht@users.noreply.github.com> --------- Co-authored-by: Maneesh Tewani <maneesht@users.noreply.github.com>
* Fixing init dataconnect on some empty schema cases * Ensure schema.gql, not just dir, and add test * Update src/init/features/dataconnect/index.ts Co-authored-by: Maneesh Tewani <maneesht@users.noreply.github.com> --------- Co-authored-by: Maneesh Tewani <maneesht@users.noreply.github.com>
Description
Fixes an issue where
firebase init dataconnect
would error out when importing services that have schemas with no GQL files. Thanks @maneesht for debugging this with me!