Skip to content

Fix JsonElement serialization for StrawberryShake - #6683

Merged
michaelstaib merged 6 commits into
ChilliCream:mainfrom
david-driscoll:fix/object-scalar-serialization
Nov 10, 2023
Merged

michaelstaib merged 6 commits into
ChilliCream:mainfrom
david-driscoll:fix/object-scalar-serialization

Conversation

@david-driscoll

Copy link
Copy Markdown
Contributor

Closes #6617

* Added JSON scalar to StarWars character for testing
* Added failing test to verify issue ChilliCream#6617
* Added support for serializing JsonElement and JsonDocument
@CLAassistant

CLAassistant commented Nov 8, 2023 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Nov 8, 2023 •

Copy link
Copy Markdown

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (6965960) 78.98% compared to head (623df7a) 78.24%.
Report is 67 commits behind head on main.

❗ Current head 623df7a differs from pull request most recent head 5c67282. Consider uploading reports for the commit 5c67282 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6683      +/-   ##
==========================================
- Coverage   78.98%   78.24%   -0.75%     
==========================================
  Files        2903     2555     -348     
  Lines      139771   127698   -12073     
==========================================
- Hits       110397    99913   -10484     
+ Misses      29374    27785    -1589     
Flag Coverage Δ
unittests 78.24% <80.95%> (-0.75%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...e/src/CookieCrumble/Extensions/WriterExtensions.cs 100.00% <ø> (ø)
...CookieCrumble/src/CookieCrumble/TestEnvironment.cs 0.00% <ø> (ø)
...polloFederationRequestExecutorBuilderExtensions.cs 66.66% <100.00%> (ø)
...ensions/ApolloFederationSchemaBuilderExtensions.cs 86.66% <ø> (ø)
.../src/ApolloFederation/FederationTypeInterceptor.cs 100.00% <100.00%> (ø)
...ion/src/ApolloFederation/Helpers/ArgumentParser.cs 68.65% <100.00%> (+0.47%) ⬆️
...rc/AspNetCore.CommandLine/Command/ExportCommand.cs 100.00% <100.00%> (ø)
...tChocolateAspNetCoreServiceCollectionExtensions.cs 93.33% <ø> (+26.66%) ⬆️
...rc/AspNetCore/Extensions/HttpResponseExtensions.cs 26.31% <ø> (+4.57%) ⬆️
...pNetCore/src/AspNetCore/GraphQLRequestException.cs 25.00% <ø> (+5.00%) ⬆️
... and 13 more

... and 901 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaelstaib

Copy link
Copy Markdown
Member

The fix caused a ton of problems in a lot of components :) I have reworked the code generator and other parts to allow easy use of the JSON scalar now.

I made a breaking change in the generated contract of the JSON scalar. To make sure that there is no leakage we are now not returning a JSON document but a JsonElement. When parsing the element we are not renting arrays from the ArrayPool.

Anyway ... this should be in the next build.

@michaelstaib
michaelstaib merged commit fde3c9c into ChilliCream:main Nov 10, 2023
@david-driscoll
david-driscoll deleted the fix/object-scalar-serialization branch November 10, 2023 15:53
michaelstaib added a commit that referenced this pull request Nov 21, 2023
Co-authored-by: Michael Staib <michael@chillicream.com>
renovate Bot referenced this pull request in orso-co/Orso.Arpa.Api Dec 22, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [HotChocolate.Abstractions](https://chillicream.com/)
([source](https://github.com/ChilliCream/graphql-platform)) | `13.7.0`
-> `13.8.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/HotChocolate.Abstractions/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/HotChocolate.Abstractions/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/HotChocolate.Abstractions/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/HotChocolate.Abstractions/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [HotChocolate.AspNetCore](https://chillicream.com/)
([source](https://github.com/ChilliCream/graphql-platform)) | `13.7.0`
-> `13.8.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/HotChocolate.AspNetCore/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/HotChocolate.AspNetCore/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/HotChocolate.AspNetCore/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/HotChocolate.AspNetCore/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [HotChocolate.AspNetCore.Authorization](https://chillicream.com/)
([source](https://github.com/ChilliCream/graphql-platform)) | `13.7.0`
-> `13.8.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/HotChocolate.AspNetCore.Authorization/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/HotChocolate.AspNetCore.Authorization/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/HotChocolate.AspNetCore.Authorization/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/HotChocolate.AspNetCore.Authorization/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [HotChocolate.Data](https://chillicream.com/)
([source](https://github.com/ChilliCream/graphql-platform)) | `13.7.0`
-> `13.8.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/HotChocolate.Data/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/HotChocolate.Data/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/HotChocolate.Data/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/HotChocolate.Data/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [HotChocolate.Data.EntityFramework](https://chillicream.com/)
([source](https://github.com/ChilliCream/graphql-platform)) | `13.7.0`
-> `13.8.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/HotChocolate.Data.EntityFramework/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/HotChocolate.Data.EntityFramework/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/HotChocolate.Data.EntityFramework/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/HotChocolate.Data.EntityFramework/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [HotChocolate.Types](https://chillicream.com/)
([source](https://github.com/ChilliCream/graphql-platform)) | `13.7.0`
-> `13.8.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/HotChocolate.Types/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/HotChocolate.Types/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/HotChocolate.Types/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/HotChocolate.Types/13.7.0/13.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>ChilliCream/graphql-platform
(HotChocolate.Abstractions)</summary>

###
[`v13.8.0`](https://github.com/ChilliCream/graphql-platform/releases/tag/13.8.0)

[Compare
Source](https://github.com/ChilliCream/graphql-platform/compare/13.7.0...13.8.0)

##### What's Changed

- Fixed issue with the fusion configuration rewriter.
([https://github.com/ChilliCream/graphql-platform/pull/6670](https://github.com/ChilliCream/graphql-platform/pull/6670))
- Adds example for failing error interface
([https://github.com/ChilliCream/graphql-platform/pull/6665](https://github.com/ChilliCream/graphql-platform/pull/6665))
- Set limit on serialized message size in Subscriptions.Postgres
([https://github.com/ChilliCream/graphql-platform/pull/6678](https://github.com/ChilliCream/graphql-platform/pull/6678))
-   Fix JsonElement serialization for StrawberryShake
- Reworked JSON scalar usage with StrawberryShake.
([https://github.com/ChilliCream/graphql-platform/pull/6683](https://github.com/ChilliCream/graphql-platform/pull/6683))
- Updated BananaCakePop Default Version
([https://github.com/ChilliCream/graphql-platform/pull/6687](https://github.com/ChilliCream/graphql-platform/pull/6687))
- Make postgres subscription provider compatible with npgsql 8
([https://github.com/ChilliCream/graphql-platform/pull/6686](https://github.com/ChilliCream/graphql-platform/pull/6686))
- Handle JsonElement JsonValueKind.Null when deserializing
([https://github.com/ChilliCream/graphql-platform/pull/6481](https://github.com/ChilliCream/graphql-platform/pull/6481))
- Fixed Utf8JsonWriterHelper to not ignore null dictionary values
([https://github.com/ChilliCream/graphql-platform/pull/6689](https://github.com/ChilliCream/graphql-platform/pull/6689))
- Fixed the ghost files in Rider when using strawberyy shake
([https://github.com/ChilliCream/graphql-platform/pull/6693](https://github.com/ChilliCream/graphql-platform/pull/6693))
- Fixed dotnet version check filter non version output for Strawberry
Shake
([https://github.com/ChilliCream/graphql-platform/pull/6699](https://github.com/ChilliCream/graphql-platform/pull/6699))
- Fixed argument naming conventions for mutation conventions.
([https://github.com/ChilliCream/graphql-platform/pull/6705](https://github.com/ChilliCream/graphql-platform/pull/6705))
- Fixed cache pollution for in/nin filter expressions
([https://github.com/ChilliCream/graphql-platform/pull/6711](https://github.com/ChilliCream/graphql-platform/pull/6711))
- Fixed large json read corruption
([https://github.com/ChilliCream/graphql-platform/pull/6713](https://github.com/ChilliCream/graphql-platform/pull/6713))
- Fixed typo in Banana Cake Pop docs
([https://github.com/ChilliCream/graphql-platform/pull/6715](https://github.com/ChilliCream/graphql-platform/pull/6715))
- Update open api schema snapshot to fix unit tests
([https://github.com/ChilliCream/graphql-platform/pull/6708](https://github.com/ChilliCream/graphql-platform/pull/6708))
- Fixed array writer reset
([https://github.com/ChilliCream/graphql-platform/pull/6719](https://github.com/ChilliCream/graphql-platform/pull/6719))
- \[maintenance] Empty type termination using semicolon.
[https://github.com/ChilliCream/graphql-platform/pull/6725](https://github.com/ChilliCream/graphql-platform/pull/6725)5)
- Added apollo federation docs
([https://github.com/ChilliCream/graphql-platform/pull/5791](https://github.com/ChilliCream/graphql-platform/pull/5791))
- Fixed example in docs
([https://github.com/ChilliCream/graphql-platform/pull/6733](https://github.com/ChilliCream/graphql-platform/pull/6733))
- StrawberryShake documentation fixes
([https://github.com/ChilliCream/graphql-platform/pull/6742](https://github.com/ChilliCream/graphql-platform/pull/6742))
- Adds more documentation for BCP
([https://github.com/ChilliCream/graphql-platform/pull/6709](https://github.com/ChilliCream/graphql-platform/pull/6709))
- Avoid writing BOM in StrawberryShake Tools
([https://github.com/ChilliCream/graphql-platform/pull/6751](https://github.com/ChilliCream/graphql-platform/pull/6751))
- Fixed transport layer byte-array handling.
([https://github.com/ChilliCream/graphql-platform/pull/6763](https://github.com/ChilliCream/graphql-platform/pull/6763))
- Fixed SSE message corruption
([https://github.com/ChilliCream/graphql-platform/pull/6642](https://github.com/ChilliCream/graphql-platform/pull/6642))
- Do not send omitted arguments with default values to subgraph
([https://github.com/ChilliCream/graphql-platform/pull/6767](https://github.com/ChilliCream/graphql-platform/pull/6767))
- Fixed mutation error dependency registration.
([https://github.com/ChilliCream/graphql-platform/pull/6674](https://github.com/ChilliCream/graphql-platform/pull/6674))
- Fixed issue with default values on mutations.
([https://github.com/ChilliCream/graphql-platform/pull/6776](https://github.com/ChilliCream/graphql-platform/pull/6776))
- Fixed CostAttribute multiplier path signature.
([https://github.com/ChilliCream/graphql-platform/pull/6777](https://github.com/ChilliCream/graphql-platform/pull/6777))
- Fixed issue that caused the tag directive to be ignored.
([https://github.com/ChilliCream/graphql-platform/pull/6746](https://github.com/ChilliCream/graphql-platform/pull/6746))
- Fixed broken postgres tests
([https://github.com/ChilliCream/graphql-platform/pull/6779](https://github.com/ChilliCream/graphql-platform/pull/6779))
- Fixed Keyed Services
([https://github.com/ChilliCream/graphql-platform/pull/6782](https://github.com/ChilliCream/graphql-platform/pull/6782))
- Fixed Tag Composition Tooling
([https://github.com/ChilliCream/graphql-platform/pull/6783](https://github.com/ChilliCream/graphql-platform/pull/6783))
- EF Core middleware must check for IAsyncEnumerable.
([https://github.com/ChilliCream/graphql-platform/pull/6784](https://github.com/ChilliCream/graphql-platform/pull/6784))

**Full Changelog**:
ChilliCream/graphql-platform@13.7.0...13.8.0-preview.8

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 10pm every weekday,every
weekend,before 5am every weekday" in timezone Europe/Berlin, Automerge -
At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/orso-co/Orso.Arpa.Api).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@PascalSenn PascalSenn mentioned this pull request Feb 19, 2024
@PascalSenn PascalSenn mentioned this pull request May 22, 2024
@PascalSenn PascalSenn mentioned this pull request Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StrawberryShake cannot consume JSON scalar

3 participants