Skip to content

feat(ir): add scaffolding for GraphQL SDK generation via Transport.graphql#16722

Draft
cadesark wants to merge 6 commits into
mainfrom
devin/1782416524-graphql-sdk-generation
Draft

feat(ir): add scaffolding for GraphQL SDK generation via Transport.graphql#16722
cadesark wants to merge 6 commits into
mainfrom
devin/1782416524-graphql-sdk-generation

Conversation

@cadesark

Copy link
Copy Markdown
Contributor

Description

Adds the file structure and type stubs for GraphQL SDK generation using "Path B" (GraphQL-Aware approach). Each GraphQL root field becomes a synthetic HttpEndpoint with a new Transport.graphql variant carrying a pre-built query string, typed variables as the request body, and the unwrapped return type as the response.

No implementation logic yet — all functions are stubs with TODO markers describing the algorithm at each point.

Changes Made

Layer 1: IR Type Changes

  • New graphql.yml definition file (parallel to proto.yml):
    • GraphqlTransport { query: string, operationType, operationName }
    • GraphqlOperationType enum: QUERY | MUTATION | SUBSCRIPTION
  • Added graphql: graphql.GraphqlTransport variant to Transport union in http.yml
  • Bumped IR version 67.6.067.7.0

Layer 2: GraphQL → IR Converter

  • GraphQLToIRConverter class — main entry, parallel to ProtobufIRGenerator
  • ir-conversion/convertGraphQLTypes.ts — schema objects/enums/unions → IR TypeDeclarations
  • ir-conversion/convertRootFieldToEndpoint.ts — root field → HttpEndpoint with Transport.graphql

Layer 5: Query Auto-Generation

  • query-generation/generateSelectionQuery.ts — produces full-selection query string per root field
  • SelectionSetBuilder class — hybrid depth limiting (cycle detection + max depth 4 cap)

Layer 3: Pipeline Integration

  • GraphQLIRGenerator in lazy-fern-workspace/src/graphql/ — calls converter, returns IR for merging
  • INTEGRATION_NOTES.md — documents exact OSSWorkspace + SdkChecker changes needed to wire it in

Exports

  • Updated packages/cli/api-importers/graphql/src/index.ts to export GraphQLToIRConverter + query utilities

Testing

  • This is scaffolding only — no runtime behavior yet
  • Implementation will be filled in subsequent PRs
  • pnpm ir:generate and generator updates are deferred until stubs are implemented

Link to Devin session: https://app.devin.ai/sessions/d32b64ce79af434b8e931a4fd849e058
Requested by: @cadesark

Layer 1 - IR Changes:
- Add Transport.graphql variant to http.yml union type
- Create graphql.yml defining GraphqlTransport + GraphqlOperationType
- Bump IR version 67.6.0 → 67.7.0
- Update CHANGELOG.md

Layer 2 - GraphQL → IR Converter:
- GraphQLToIRConverter class (main entry point, parallel to ProtobufIRGenerator)
- ir-conversion/convertGraphQLTypes.ts (schema types → IR TypeDeclarations)
- ir-conversion/convertRootFieldToEndpoint.ts (root fields → HttpEndpoints)

Layer 5 - Query Auto-Generation:
- query-generation/generateSelectionQuery.ts (depth-limited full selection)
- SelectionSetBuilder class with cycle detection + max depth cap

Layer 3 - Pipeline Integration:
- GraphQLIRGenerator in lazy-fern-workspace (calls GraphQLToIRConverter)
- INTEGRATION_NOTES.md documenting OSSWorkspace + SdkChecker changes

All files are stubs with TODO markers — no implementation logic yet.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@cadesark cadesark self-assigned this Jun 25, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 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

fern-support and others added 5 commits June 25, 2026 19:53
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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