Skip to content

Commit 95739c6

Browse files
authored
Merge branch 'main' into tte/disable-null-bubbling-option
2 parents 5657e54 + a3b1259 commit 95739c6

File tree

1,399 files changed

+7580
-459456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,399 files changed

+7580
-459456
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,6 @@ jobs:
183183
7.x
184184
8.x
185185
186-
- uses: actions/cache@v3
187-
with:
188-
path: ~/.nuget/packages
189-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
190-
restore-keys: |
191-
${{ runner.os }}-nuget-
192-
193186
- name: Run Build
194187
id: run-build
195188
run: dotnet build ${{ matrix.path }} --framework net7.0 --verbosity q --property WarningLevel=0
@@ -282,11 +275,7 @@ jobs:
282275
path: |
283276
**/__mismatch__/*
284277
285-
- name: Fail if tests failed or were cancelled
286-
run: exit 1
287-
if: |
288-
steps.run-tests.outcome == 'failure' ||
289-
steps.run-tests.outcome == 'cancelled'
278+
290279
291280
codeql:
292281
name: CodeQL
@@ -311,13 +300,6 @@ jobs:
311300
7.x
312301
8.x
313302
314-
- uses: actions/cache@v3
315-
with:
316-
path: ~/.nuget/packages
317-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
318-
restore-keys: |
319-
${{ runner.os }}-nuget-
320-
321303
- name: Restore
322304
run: ./build.sh restore
323305

@@ -350,14 +332,6 @@ jobs:
350332
7.x
351333
8.x
352334
353-
- uses: actions/cache@v3
354-
if: ${{ !cancelled() }}
355-
with:
356-
path: ~/.nuget/packages
357-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
358-
restore-keys: |
359-
${{ runner.os }}-nuget-
360-
361335
- name: Create All.sln
362336
if: ${{ !cancelled() }}
363337
run: ./build.sh CreateAllSln

.github/workflows/coverage.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ jobs:
5858
7.x
5959
8.x
6060
61-
- uses: actions/cache@v3
62-
with:
63-
path: ~/.nuget/packages
64-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
65-
restore-keys: |
66-
${{ runner.os }}-nuget-
67-
6861
- name: Run Build
6962
id: run-build
7063
run: dotnet build ${{ matrix.path }} --framework net7.0 --verbosity q --property WarningLevel=0
@@ -128,14 +121,6 @@ jobs:
128121
7.x
129122
8.x
130123
131-
- uses: actions/cache@v3
132-
if: ${{ !cancelled() }}
133-
with:
134-
path: ~/.nuget/packages
135-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
136-
restore-keys: |
137-
${{ runner.os }}-nuget-
138-
139124
- name: Create All.sln
140125
if: ${{ !cancelled() }}
141126
run: ./build.sh CreateAllSln

.github/workflows/release.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ jobs:
2424
id: get_version
2525
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
2626

27-
- uses: actions/cache@v3
28-
with:
29-
path: ~/.nuget/packages
30-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
31-
restore-keys: |
32-
${{ runner.os }}-nuget-
33-
3427
- name: Build Packages
3528
run: |
3629
./build.sh pack --SemVersion ${{ env.GIT_TAG }} --Configuration Release

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,3 +323,4 @@ conferences.db-wal
323323
.server/
324324
.nuke/
325325
.mono/
326+
packages.lock.json

src/CookieCrumble/src/CookieCrumble/Extensions/SnapshotExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static void MatchInlineSnapshot(
1515

1616
public static void MatchSnapshot(this Snapshot value)
1717
=> value.Match();
18-
18+
1919
public static void MatchSnapshot(
2020
this object? value,
2121
object? postFix = null,

src/CookieCrumble/src/CookieCrumble/Formatters/ExecutionResultSnapshotValueFormatter.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Buffers;
2-
using System.Runtime.InteropServices;
32
using System.Text.Json;
43
using System.Text.Json.Nodes;
54
using HotChocolate;
@@ -21,6 +20,26 @@ protected override void Format(IBufferWriter<byte> snapshot, IExecutionResult va
2120
FormatStreamAsync(snapshot, (IResponseStream)value).Wait();
2221
}
2322
}
23+
24+
protected override void FormatMarkdown(IBufferWriter<byte> snapshot, IExecutionResult value)
25+
{
26+
if (value.Kind is ExecutionResultKind.SingleResult)
27+
{
28+
snapshot.Append("```json");
29+
snapshot.AppendLine();
30+
snapshot.Append(value.ToJson());
31+
}
32+
else
33+
{
34+
snapshot.Append("```text");
35+
snapshot.AppendLine();
36+
FormatStreamAsync(snapshot, (IResponseStream)value).Wait();
37+
}
38+
39+
snapshot.AppendLine();
40+
snapshot.Append("```");
41+
snapshot.AppendLine();
42+
}
2443

2544
private static async Task FormatStreamAsync(
2645
IBufferWriter<byte> snapshot,
@@ -79,7 +98,7 @@ private static async Task FormatStreamAsync(
7998
}
8099
}
81100

82-
internal class JsonResultPatcher
101+
internal sealed class JsonResultPatcher
83102
{
84103
private const string _data = "data";
85104
private const string _items = "items";

src/CookieCrumble/src/CookieCrumble/Formatters/GraphQLHttpResponseFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ private static async Task FormatStreamAsync(
6565
}
6666
}
6767
}
68-
}
68+
}

src/CookieCrumble/src/CookieCrumble/Formatters/GraphQLSnapshotValueFormatter.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Buffers;
2-
using HotChocolate;
32
using HotChocolate.Language;
43
using HotChocolate.Language.Utilities;
54

@@ -27,4 +26,14 @@ protected override void Format(IBufferWriter<byte> snapshot, ISyntaxNode value)
2726

2827
ArrayPool<char>.Shared.Return(buffer);
2928
}
29+
30+
protected override void FormatMarkdown(IBufferWriter<byte> snapshot, ISyntaxNode value)
31+
{
32+
snapshot.Append("```graphql");
33+
snapshot.AppendLine();
34+
Format(snapshot, value);
35+
snapshot.AppendLine();
36+
snapshot.Append("```");
37+
snapshot.AppendLine();
38+
}
3039
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.Buffers;
2+
3+
namespace CookieCrumble.Formatters;
4+
5+
/// <summary>
6+
/// Formats a snapshot segment value for the snapshot file.
7+
/// </summary>
8+
public interface IMarkdownSnapshotValueFormatter
9+
{
10+
/// <summary>
11+
/// Specifies if the formatter can handle the snapshot segment value.
12+
/// </summary>
13+
/// <param name="value">
14+
/// The snapshot segment value.
15+
/// </param>
16+
/// <returns>
17+
/// <c>true</c> if the formatter can handle the snapshot segment value;
18+
/// otherwise, <c>false</c>.
19+
/// </returns>
20+
bool CanHandle(object? value);
21+
22+
/// <summary>
23+
/// Formats the specified snapshot segment value for the snapshot file.
24+
/// </summary>
25+
/// <param name="snapshot">
26+
/// The snapshot file writer.
27+
/// </param>
28+
/// <param name="value">
29+
/// The snapshot segment vale.
30+
/// </param>
31+
void FormatMarkdown(IBufferWriter<byte> snapshot, object? value);
32+
}

src/CookieCrumble/src/CookieCrumble/Formatters/ISnapshotValueFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ public interface ISnapshotValueFormatter
2929
/// The snapshot segment vale.
3030
/// </param>
3131
void Format(IBufferWriter<byte> snapshot, object? value);
32-
}
32+
}

0 commit comments

Comments
 (0)