feat: add codegen fixture example with schema and generated output#727
Closed
pyramation wants to merge 1 commit intomainfrom
Closed
feat: add codegen fixture example with schema and generated output#727pyramation wants to merge 1 commit intomainfrom
pyramation wants to merge 1 commit intomainfrom
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
feat: add codegen fixture example with schema and generated output
Summary
Adds a
__fixtures__/codegen-example/directory demonstrating the full codegen pipeline output from a PostGraphile v5-style GraphQL schema. Contains:schema.graphql— Hand-written input schema with 4 entities (User, Post, Comment, Category), connection types, filters, enums, and CRUD mutationsgenerate.ts— Script showing how to invokegenerate()withschemaFile+orm: trueoutput/— The actual generated ORM client code (models, client factory, query builder, select types, input types)The output was produced by running the codegen against the example schema locally. This fixture exists purely to make the codegen output visible and reviewable without needing a database.
Review & Testing Checklist for Human
findMany,findFirst,findOne,create,update,delete) and that relation fields (e.g.,User.posts,Post.author) are reflected in the select typesinput-types.tsfilter type bloat — The codegen generates ~775 lines of standard filter types (BigIntFilter,InternetAddressFilter,FullTextFilter, etc.) even though the schema only defines a few simple filters. Verify this is acceptable/expected behaviorPageInfo, nested connection fields on entities). Confirm it's representative of real-world usagegenerate.tsimports@constructive-io/graphql-codegen— The script was actually run with a relative import and then switched to the package import for the committed version. It won't run standalone without the package linked. Consider if this is fine as documentation or if it needs adjustmentNotes
@generatedand import from@constructive-io/graphql-types— they're meant to show codegen output structure, not to be compiled independentlypnpm buildpasses with these fixture files present (they're not part of any workspace package)Link to Devin run: https://app.devin.ai/sessions/467080f279b64f0b9d1b7600cc050971
Requested by: @pyramation