fix(cli): include field-level arguments in GraphQL object type conversion#16171
Conversation
Co-Authored-By: rishabh <rishabh@buildwithfern.com>
🤖 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:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
@claude review |
Co-Authored-By: rishabh <rishabh@buildwithfern.com>
There was a problem hiding this comment.
Snapshot regeneration concern from my prior review is addressed in d9a9363. Type-annotation weakening is intentional pending the fern-platform companion PR.
Extended reasoning...
Overview
This PR adds field-level arguments to GraphQL object-type and interface-as-object conversions in GraphQLConverter.ts, mirroring the existing logic already used in convertField for top-level operations. Two functions are touched (convertObjectTypeDefinition, convertInterfaceAsObject), each gains an arguments property on its emitted ObjectProperty using the existing convertArgument helper. The account-schema.json snapshot was regenerated and a CLI changelog entry was added.
Security risks
None. This is read-only schema conversion: the converter ingests a GraphQL SDL file and emits FDR-shaped JSON. No auth, crypto, network, or filesystem write surfaces are touched.
Level of scrutiny
Low. This is a small, mechanical change — extracting field.args and reusing an existing well-tested converter (convertArgument). The same pattern was already in place in convertField for operation-level arguments. The snapshot diff makes the behavioral effect fully visible.
Other factors
My previous review flagged the missing snapshot regeneration; commit d9a93638 addressed it, and the diff now shows the full set of expected arguments arrays under nested object fields. The Devin reviewer flagged that the inline return-type annotation was moved to a variable-level annotation, weakening excess-property checking against an FDR SDK type that does not yet declare arguments. The author confirmed this is a temporary measure coordinated with fern-platform PR #11702 — once that merges and the FDR SDK is republished, the dep will be bumped and the inline annotation restored. The data is preserved through Zod passthrough until then.
Docs Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on
Docs generation runs |
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
Description
Refs fern-api/fern-platform#(companion PR)
Include field-level arguments when converting GraphQL object types and interfaces to FDR format.
Changes Made
GraphQLConverter.convertObjectTypeDefinition: Extractfield.argsand convert via existingconvertArgument()method, populatingargumentson eachObjectPropertyGraphQLConverter.convertInterfaceAsObject: Same treatment for interface-as-object fieldsPreviously,
convertArgument()was only called for top-level operation arguments. Now it's also called for nested object type fields — e.g.,Image.url(width: Int!, height: Int, lossy: Boolean)will producearguments: [{name: "width", type: nonNull(Int)}, ...]on the property.Depends on: fern-api/fern-platform companion PR that adds
argumentstoObjectPropertyschema and renders it.Testing
pnpm turbo run compile --filter=@fern-api/graphql-to-fdrpassesLink to Devin session: https://app.devin.ai/sessions/60b3e0b90ffd47e09585a40f48dad888