Skip to content

fix(cli): include field-level arguments in GraphQL object type conversion#16171

Merged
rishabh-fern merged 5 commits into
mainfrom
devin/1780348173-graphql-field-arguments
Jun 12, 2026
Merged

fix(cli): include field-level arguments in GraphQL object type conversion#16171
rishabh-fern merged 5 commits into
mainfrom
devin/1780348173-graphql-field-arguments

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

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: Extract field.args and convert via existing convertArgument() method, populating arguments on each ObjectProperty
  • GraphQLConverter.convertInterfaceAsObject: Same treatment for interface-as-object fields
  • Added CLI changelog entry

Previously, 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 produce arguments: [{name: "width", type: nonNull(Int)}, ...] on the property.

Depends on: fern-api/fern-platform companion PR that adds arguments to ObjectProperty schema and renders it.

Testing

  • pnpm turbo run compile --filter=@fern-api/graphql-to-fdr passes
  • Manual testing completed

Link to Devin session: https://app.devin.ai/sessions/60b3e0b90ffd47e09585a40f48dad888


Open in Devin Review

Co-Authored-By: rishabh <rishabh@buildwithfern.com>
@devin-ai-integration devin-ai-integration Bot requested a review from amckinney as a code owner June 1, 2026 21:10
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@devin-ai-integration devin-ai-integration Bot changed the title fix: include field-level arguments in GraphQL object type conversion fix(cli): include field-level arguments in GraphQL object type conversion Jun 1, 2026
@fern-support

Copy link
Copy Markdown
Collaborator

@claude review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/cli/api-importers/graphql/src/GraphQLConverter.ts
Co-Authored-By: rishabh <rishabh@buildwithfern.com>
Comment thread packages/cli/api-importers/graphql/src/GraphQLConverter.ts

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-06-12T05:33:38Z).

Fixture main PR Delta
docs 230.4s (n=5) 234.7s (35 versions) +4.3s (+1.9%)

Docs generation runs fern generate --docs --preview end-to-end against the benchmark fixture with 35 API versions (each version: markdown processing + OpenAPI-to-IR + FDR upload).
Delta is computed against the nightly baseline on main.
Baseline from nightly run(s) on main (latest: 2026-06-12T05:33:38Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-06-12 20:06 UTC

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-06-12T05:33:38Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 70s (n=5) 111s (n=5) 72s +2s (+2.9%)
go-sdk square 132s (n=5) 287s (n=5) 128s -4s (-3.0%)
java-sdk square 237s (n=5) 281s (n=5) 231s -6s (-2.5%)
php-sdk square 60s (n=5) 85s (n=5) 52s -8s (-13.3%)
python-sdk square 134s (n=5) 236s (n=5) 134s +0s (+0.0%)
ruby-sdk-v2 square 91s (n=5) 119s (n=5) 86s -5s (-5.5%)
rust-sdk square 173s (n=5) 164s (n=5) 168s -5s (-2.9%)
swift-sdk square 54s (n=5) 436s (n=5) 53s -1s (-1.9%)
ts-sdk square 232s (n=5) 227s (n=5) 235s +3s (+1.3%)

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 fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-06-12T05:33:38Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-06-12 20:09 UTC

@rishabh-fern rishabh-fern merged commit ee24ea6 into main Jun 12, 2026
218 checks passed
@rishabh-fern rishabh-fern deleted the devin/1780348173-graphql-field-arguments branch June 12, 2026 21:13
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.

2 participants