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

feat: .nonNull / .nullable chaining, additional cleanup #655

Merged
merged 22 commits into from Nov 23, 2020

Conversation

tgriesser
Copy link
Member

@tgriesser tgriesser commented Nov 22, 2020

  • Fixes SDL conversion
  • Defer wrapping until types are built
  • Supports GraphQL types anywhere that a type can be used, wrapped, etc.
  • Split out the wrapping, w/ finalizeWrapping helper which adds in the NonNull to the list as needed
  • Make nonNull(nonNull(T)) & nullable(nullable(T)) no-op for simplicity
  • Change: nullable(nonNull(T)) will undo the nonNull
  • Properly type-check's subscriptionType by passing Event generic properly
  • Adds declarativeWrappingPlugin for previous nullable / list behavior

@@ -1,5 +1,5 @@
---
title: list / nonNull / nullable
title: list / nonNull
Copy link
Member Author

Choose a reason for hiding this comment

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

Since we default to nonNullDefault: false, I wanted to avoid advertising nullable in the top-level API. It's a bit of an antipattern.

@codecov
Copy link

codecov bot commented Nov 22, 2020

Codecov Report

Merging #655 (8d342d6) into develop (618521d) will increase coverage by 0.34%.
The diff coverage is 92.83%.

@@             Coverage Diff             @@
##           develop     #655      +/-   ##
===========================================
+ Coverage    93.84%   94.19%   +0.34%     
===========================================
  Files           42       44       +2     
  Lines         2744     2806      +62     
  Branches       629      648      +19     
===========================================
+ Hits          2575     2643      +68     
+ Misses         167      161       -6     
  Partials         2        2              

@tgriesser tgriesser changed the base branch from feat/null-list-chaining-api to develop November 23, 2020 03:31
src/builder.ts Outdated Show resolved Hide resolved
Copy link
Member

@Weakky Weakky left a comment

Choose a reason for hiding this comment

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

Great job, LGTM 👍

* develop:
  feat(config): SDL file generation by default in development (#652)
  chore(docs): add atomicOperations setting for prisma plugin (#587)
  deps: update to latest (#649)
  chore: Add release changelog entries to CHANGELOG.md (#656)
@tgriesser tgriesser changed the title refactor: .nonNull / .nullable improvements & changes feat: .nonNull / .nullable chaining, additional cleanup Nov 23, 2020
@tgriesser tgriesser merged commit 306dbaa into develop Nov 23, 2020
@tgriesser tgriesser deleted the feat/tgriesser/null-list-chaining-api branch November 23, 2020 15:41
9renpoto pushed a commit to 9renpoto/schema that referenced this pull request Dec 4, 2020
…s#655)

- Fixes SDL conversion
- Defer wrapping until types are built
- Supports GraphQL types anywhere that a type can be used, wrapped, etc.
- Split out the wrapping, w/ `finalizeWrapping` helper which adds in the `NonNull` to the list as needed
- Make `nonNull(nonNull(T))` & `nullable(nullable(T))` no-op for simplicity
- Change: `nullable(nonNull(T))` will undo the `nonNull`
- Properly type-check's `subscriptionType` by passing `Event` generic properly
- Adds `declarativeWrappingPlugin` for previous `nullable` / `list` behavior

Co-authored-by: Flavian DESVERNE <flavian.desverne@epitech.eu>
imgbot bot pushed a commit to 9renpoto/schema that referenced this pull request Dec 4, 2020
…s#655)

- Fixes SDL conversion
- Defer wrapping until types are built
- Supports GraphQL types anywhere that a type can be used, wrapped, etc.
- Split out the wrapping, w/ `finalizeWrapping` helper which adds in the `NonNull` to the list as needed
- Make `nonNull(nonNull(T))` & `nullable(nullable(T))` no-op for simplicity
- Change: `nullable(nonNull(T))` will undo the `nonNull`
- Properly type-check's `subscriptionType` by passing `Event` generic properly
- Adds `declarativeWrappingPlugin` for previous `nullable` / `list` behavior

Co-authored-by: Flavian DESVERNE <flavian.desverne@epitech.eu>
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.

None yet

2 participants