Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(graphql): Support @Field of list type in IntersectionType #2276

Merged
merged 1 commit into from Jul 8, 2022
Merged

fix(graphql): Support @Field of list type in IntersectionType #2276

merged 1 commit into from Jul 8, 2022

Conversation

exarus
Copy link
Contributor

@exarus exarus commented Jul 2, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #1420

What is the new behavior?

IntersectionType
Fix @field of List type in IntersectionType.
Previously array wrapper was ignored and GraphQL List wrapper was not applied:

// [String] was interpreted as String
@Field(() => [String])

In suggested changes IntersectionType executes type function to support GraphQL List types.
Other helpers (PickType, OmitType) are using same approach.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Previous PR (#1420) executed type functions eagerly, so could not be merged.
Furthermore it was abandoned more than a year ago, closed for commenting and modification.

Fix @field of List type in IntersectionType.
Previously array wrapper was ignored and GraphQL List wrapper was not applied:
```typescript
// [String] was interpreted as String
@field(() => [String])
```

Fixes #1420
@kamilmysliwiec
Copy link
Member

LGTM

@kamilmysliwiec kamilmysliwiec merged commit 4ba6e19 into nestjs:master Jul 8, 2022
@exarus exarus deleted the fix-list-field-in-intersection branch July 13, 2022 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants