aws-amplify / aws-amplify/amplify-codegen

Use maxDepth for specific connection directives in schema for Amplify Codegen

Open
#251 0 comments 0 reactions 0 assignees View on GitHub
feature-request p4 plugins-support transferred
Dominant language
TypeScript
Stars
59
Forks
64
PR merge metrics
No merged PRs in 30d

Description

### Is this related to a new or existing Amplify category?

api

### Is this related to another service?

_No response_

### Describe the feature you'd like to request

For the generation of types one can set maxDepth for all connection directives. But on the one hand this is not necessary for all connection fields and on the other hand we need some fields to be set with more depth.

It would be great to have the option to set the maxDepth specifically for a connection field.
Other connection fields not set specifically can take the default value set in `.graphqlconfig.yml`

### Describe the solution you'd like

Option to set the maxDepth specifically for a connection field like:
```graphql
orderPositions: [OrderPosition!]! @connection(keyName: "orderPositionsByOrder", fields: ["id"], maxDepth: 6)
```
### Describe alternatives you've considered

Define custom types for each connection field.

### Additional context

_No response_

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Start by tracing how Amplify Codegen reads connection directives and the default maxDepth from .graphqlconfig.yml. Check how the example @connection field is represented during type generation, then define what should happen when a field-level maxDepth is present versus when only the global default is set.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.