Skip to content

fix(demo): rebuild products_fg as clean products + productCount delta - #3108

Open
jvr545 wants to merge 1 commit into
mainfrom
fix/align-products-fg-schema
Open

fix(demo): rebuild products_fg as clean products + productCount delta#3108
jvr545 wants to merge 1 commit into
mainfrom
fix/align-products-fg-schema

Conversation

@jvr545

@jvr545 jvr545 commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Rebuild products_fg subgraph to be a clean copy of products with only one addition: Employee.productCount: Int!

Changes

  • Sync schema.graphqls with base products (restore @cost/@listSize directives, Thing type, sharedThings/slicedThings/searchThings queries)
  • Remove junk comment # dwedwedew
  • Add missing resolvers (SharedThings, SlicedThings, SearchThings)
  • Fix employee ID 7 missing ProductCount value
  • Regenerate gqlgen artifacts

Schema delta (products_fg vs products)

type Employee @key(fields: "id") {
  id: Int!
  products: [ProductName!]!
+ productCount: Int!
  notes: String @override(from: "employees")
}

Test plan

  • go generate succeeds
  • go build ./cmd/products_fg succeeds
  • _entities query returns productCount: 5 for Employee id 1
  • SDL includes all restored fields and directives

Deploy reminder

After merge, redeploy Fly app product-api-fs using demo/docker/products_fg.Dockerfile

Linear

Resolves MAR2-3879: Draft Cosmo PR: rebuild products_fg as 1-to-1 with products + productCount

Summary by CodeRabbit

  • New Features
    • Added product search with optional query and pagination support.
    • Added shared and sliced item queries with configurable result ranges.
    • Added pagination controls using first and after parameters.
  • Improvements
    • Added safeguards for invalid ranges and oversized requests.
    • Added query size and cost metadata to improve request control and performance predictability.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Router image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-40eac2aaf95382fb6148d046e5d26bafbfe54973

@jvr545
jvr545 force-pushed the fix/align-products-fg-schema branch from aeb0bee to 1079d6c Compare July 23, 2026 06:07
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

Product query support

Layer / File(s) Summary
Query schema and models
demo/pkg/subgraphs/products_fg/subgraph/schema.graphqls, demo/pkg/subgraphs/products_fg/subgraph/model/models_gen.go
GraphQL directives, Thing query fields, pagination inputs, and corresponding Go model types are added.
Thing query resolvers
demo/pkg/subgraphs/products_fg/subgraph/schema.resolvers.go
Resolvers generate formatted Thing values, validate bounds, and apply pagination inputs. FactContent and Cosmo also receive cost annotations.

Employee fixture update

Layer / File(s) Summary
Employee record update
demo/pkg/subgraphs/products_fg/subgraph/employees.go
The employee entry with the products note now includes ProductCount: 2 and adjusted Notes formatting.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main goal: rebuilding products_fg around clean products data and a productCount delta.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

router - uncommitted changes detected

Seems like you forgot to commit some code. Possible causes:

  • Generated code not part of the PR, fix with: make generate and commit the changes
  • Dependency mismatch for tools (protoc, etc). Ensure your local machine has same versions of tools as CI does
  • Formatting drift, fix with make format router / pnpm format router

Dirty files
  • router-tests/testenv/testdata/config.json

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.95%. Comparing base (8271c7d) to head (1079d6c).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3108       +/-   ##
===========================================
+ Coverage   48.81%   49.95%    +1.14%     
===========================================
  Files        1130      247      -883     
  Lines      157426    30303   -127123     
  Branches    10880        0    -10880     
===========================================
- Hits        76842    15138    -61704     
+ Misses      78713    13604    -65109     
+ Partials     1871     1561      -310     

see 1028 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jvr545
jvr545 marked this pull request as ready for review July 23, 2026 17:34
@jvr545
jvr545 requested review from a team as code owners July 23, 2026 17:34
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added Stale and removed Stale labels Aug 7, 2026
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.

1 participant