Skip to content

chore: remove Item and SavedItem references from corpus API subgraph - #399

Draft
jpetto wants to merge 1 commit into
mainfrom
HNT-1542-clean-up-graph-remove-item-saveditem-references
Draft

chore: remove Item and SavedItem references from corpus API subgraph#399
jpetto wants to merge 1 commit into
mainfrom
HNT-1542-clean-up-graph-remove-item-saveditem-references

Conversation

@jpetto

@jpetto jpetto commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
  • this will let us delete the parser subgraph

Goal

What changed? What is the business/product goal?

  • Change 1
  • Change 2

I'd love feedback/perspectives on:

Implementation Decisions

Deployment steps

  • Database migrations?
  • Deployed to dev?
  • Secrets?

References

JIRA ticket:

  • Link to JIRA ticket

Issue:

  • Link to GitHub issue

Documentation:

  • Project doc

@claude

claude Bot commented Jul 8, 2026

Copy link
Copy Markdown

Claude finished @jpetto's task in 2m 2s —— View job


Code Review: PR #399 — remove Item/SavedItem from corpus API subgraph

  • Read PR diff
  • Analyze schema/federation implications
  • Check for related references
  • Post review

The SDL change itself is clean, but it looks incomplete — the schema file that was edited is the runtime schema, and the matching resolvers and tests were left behind.

🔴 Blocker: server will fail to boot

schema-public.graphql isn't just a published/composition artifact — it's read directly at runtime to build the executable schema:

// src/typeDefs.ts:9-14
export const typeDefsPublic = gql(
  fs.readFileSync(path.join(__dirname, '..', 'schema-public.graphql')).toString()
     .concat(sharedSchema)
);
// src/public/schema.ts
export const schema = buildSubgraphSchema({ typeDefs: typeDefsPublic, resolvers });

The resolvers passed to buildSubgraphSchema still define SavedItem and Item:

// src/public/resolvers/index.ts:25-38  → SavedItem.corpusItem
// src/public/resolvers/index.ts:45-68  → Item.corpusItem

@apollo/subgraph (2.9.0) applies these via addResolversToSchema, which defaults requireResolversToMatchSchema to 'error'. With the types now gone from the typeDefs, building the schema should throw something like "SavedItem defined in resolvers, but not in schema" at startup. Please verify by booting the server / running the suite — but as it stands this PR removes the type but not its resolver.

Fix: delete the SavedItem and Item resolver blocks in src/public/resolvers/index.ts.

Fix this →

🟠 Orphaned tests

src/public/resolvers/queries/CorpusItem.integration.ts:448-590 contains reference-resolver tests for both types:

  • describe('reference resolver for SavedItem', ...) (L448)
  • it('returns the corpus item if it exists on Item', ...) and the resolvedUrl fallback cases (L497-590)

These exercise resolvers/types that no longer exist and should be removed alongside the resolvers.

🟡 Sample query fragments

src/public/resolvers/queries/sample-queries.gql.ts still has ... on SavedItem (L65) and ... on Item (L74) selections. Not runtime-critical, but they reference the removed types and should be cleaned up for consistency.

Note on the "delete the parser subgraph" goal

Removing the Item extension (which used resolvedUrl: Url @external + @requires) does drop this subgraph's dependency on the parser — good. Just confirm no other subgraph still @requires/@external-references fields that only the parser provides before the parser subgraph is actually deleted, otherwise supergraph composition will fail.


Summary: SDL deletion is correct in intent, but because schema-public.graphql is the live schema source, the corresponding SavedItem/Item resolvers (index.ts) and tests (CorpusItem.integration.ts) must be removed in the same PR — otherwise the subgraph won't start. This is a review only; I have not made changes.
· HNT-1542-clean-up-graph-remove-item-saveditem-references

@jpetto
jpetto force-pushed the HNT-1542-clean-up-graph-remove-item-saveditem-references branch 4 times, most recently from 0d80944 to 1c71ff9 Compare July 8, 2026 16:15
- this will let us delete the parser subgraph
@jpetto
jpetto force-pushed the HNT-1542-clean-up-graph-remove-item-saveditem-references branch from 1c71ff9 to aff042a Compare July 8, 2026 19:02
@github-actions
github-actions Bot deployed to prospect-api-dev July 8, 2026 19:08 Active
@github-actions
github-actions Bot deployed to curated-corpus-api-dev July 8, 2026 19:08 Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant