dotansimha / dotansimha/graphql-code-generator

[Mappers] Mapper Not Used for Nested Types

Open
#3,131 3 comments 3 reactions 0 assignees View on GitHub
core kind/enhancement plugins
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

**Describe the bug**

When using a `defaultMapper`, nested types are not mapped to their `ResolverType`. I've provided a CodeSandbox. I've added a field, `friends`, to `User`. `friends` is of type `UserFriendsConnection`.

I'd expect that the `defaultMapper`, in this case `Required<{T}>`, be applied to the nested `User` types of `UserFriendsEdge.node` and `UserFriendsConnection.nodes`.

```
export type UserFriendsConnection = {
__typename?: 'UserFriendsConnection',
edges: Array,
nodes: Array,
totalCount: Scalars['Int'],
};

export type UserFriendsEdge = {
__typename?: 'UserFriendsEdge',
cursor: Scalars['String'],
node: User,
};
```

**To Reproduce**
Steps to reproduce the behavior:

https://codesandbox.io/s/graphql-codegen-issue-template-o0y03

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.