Fix seeding errors in exampless/usecase-blog#9830
Merged
Merged
Conversation
- Added 'status' and 'publishDate' fields to Post list in schema.ts to match seed data. - Added 'select' import to core fields. - Updated seed-data.ts to correctly transform raw content string into Document format. - Added safety check for author existence during post seeding. Resolves keystonejs#9782
Contributor
Author
|
I have updated the branch with a fix for the potential TypeScript errors in Key changes:
These changes should resolve the "Types" CI check failure. |
exampless/usecase-blog
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the seeding errors in the
usecase-blogexample reported in #9782.The issues were:
Postschema was missingstatusandpublishDatefields which are present in the example data.contentfield (Document type) was receiving a raw string from the example data, causing a GraphQL error.Changes
examples/usecase-blog/schema.tsto includestatusandpublishDatefields.selectto the imported fields inschema.ts.examples/usecase-blog/seed-data.tsto transform the rawcontentstring into a valid Document structure[{ type: 'paragraph', children: [{ text: content }] }].seed-data.tsto skip posts if the author is not found, preventing crashes.Verification
I have manually verified the schema and seed logic changes. Since this is a fix for an example's seed script, it ensures a better onboarding experience for new users.
Resolves #9782