Skip to content

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Dec 10, 2024

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!

@joehan joehan requested a review from maneesht December 10, 2024 23:50
}
} else {
// Even if the schema is empty, lets give them an emty .gql file to get started.
fs.ensureFileSync(join(dir, "schema", "schema.gql"));
Copy link
Contributor

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

Copy link
Contributor Author

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;
Copy link
Contributor

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>
@joehan joehan merged commit bc1a390 into master Dec 11, 2024
43 of 46 checks passed
@joehan joehan deleted the jh-safe-scandir branch December 11, 2024 20:20
inlined pushed a commit that referenced this pull request Dec 11, 2024
* 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>
inlined pushed a commit that referenced this pull request Dec 11, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants