Skip to content

Commit ac74d56

Browse files
Merge pull request #207 from AntonioFalcao/release
Updating
2 parents 36a7628 + 891a339 commit ac74d56

File tree

9 files changed

+97
-46
lines changed

9 files changed

+97
-46
lines changed

.assets/img/diagram.png

18.5 KB
Loading

.vscode/launch.json

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,37 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
"name": ".NET Core Launch (webAPI)",
5+
"name": "WebAPI",
66
"type": "coreclr",
77
"request": "launch",
88
"preLaunchTask": "build",
9-
"program": "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/bin/Debug/net5.0/Dotnet5.GraphQL3.Store.WebAPI.dll",
9+
"program": "${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebAPI/bin/Debug/net6.0/Dotnet6.GraphQL4.Store.WebAPI.dll",
1010
"args": [],
11-
"cwd": "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI",
11+
"cwd": "${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebAPI",
1212
"stopAtEntry": false,
1313
"serverReadyAction": {
1414
"action": "openExternally",
15-
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
15+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
16+
"uriFormat": "%s/ui/playground"
1617
},
1718
"env": {
1819
"ASPNETCORE_ENVIRONMENT": "Development"
1920
},
2021
"sourceFileMap": {
2122
"/Views": "${workspaceFolder}/Views"
23+
},
24+
"launchBrowser": {
25+
"enabled": true
2226
}
2327
},
2428
{
25-
"name": ".NET Core Launch (webMVC)",
29+
"name": "WebMVC",
2630
"type": "coreclr",
2731
"request": "launch",
2832
"preLaunchTask": "build",
29-
"program": "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebMVC/bin/Debug/net5.0/Dotnet5.GraphQL3.Store.WebMVC.dll",
33+
"program": "${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebMVC/bin/Debug/net6.0/Dotnet6.GraphQL4.Store.WebMVC.dll",
3034
"args": [],
31-
"cwd": "${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebMVC",
35+
"cwd": "${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebMVC",
3236
"stopAtEntry": false,
3337
"serverReadyAction": {
3438
"action": "openExternally",
@@ -39,13 +43,18 @@
3943
},
4044
"sourceFileMap": {
4145
"/Views": "${workspaceFolder}/Views"
46+
},
47+
"launchBrowser": {
48+
"enabled": true
4249
}
43-
},
50+
}
51+
],
52+
"compounds": [
4453
{
45-
"name": ".NET Core Attach",
46-
"type": "coreclr",
47-
"request": "attach",
48-
"processId": "${command:pickProcess}"
54+
"name": "WebAPI/WebMVC",
55+
"configurations": ["WebAPI", "WebMVC"],
56+
"preLaunchTask": "${defaultBuildTask}",
57+
"stopAll": true
4958
}
5059
]
5160
}

.vscode/tasks.json

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "process",
88
"args": [
99
"build",
10-
"${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj",
10+
"${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebAPI/Dotnet6.GraphQL4.Store.WebAPI.csproj",
1111
"/property:GenerateFullPaths=true",
1212
"/consoleloggerparameters:NoSummary"
1313
],
@@ -19,7 +19,7 @@
1919
"type": "process",
2020
"args": [
2121
"publish",
22-
"${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj",
22+
"${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebAPI/Dotnet6.GraphQL4.Store.WebAPI.csproj",
2323
"/property:GenerateFullPaths=true",
2424
"/consoleloggerparameters:NoSummary"
2525
],
@@ -32,7 +32,44 @@
3232
"args": [
3333
"watch",
3434
"run",
35-
"${workspaceFolder}/src/Dotnet5.GraphQL3.Store.WebAPI/Dotnet5.GraphQL3.Store.WebAPI.csproj",
35+
"${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebAPI/Dotnet6.GraphQL4.Store.WebAPI.csproj",
36+
"/property:GenerateFullPaths=true",
37+
"/consoleloggerparameters:NoSummary"
38+
],
39+
"problemMatcher": "$msCompile"
40+
},
41+
{
42+
"label": "build",
43+
"command": "dotnet",
44+
"type": "process",
45+
"args": [
46+
"build",
47+
"${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebMVC/Dotnet6.GraphQL4.Store.WebMVC.csproj",
48+
"/property:GenerateFullPaths=true",
49+
"/consoleloggerparameters:NoSummary"
50+
],
51+
"problemMatcher": "$msCompile"
52+
},
53+
{
54+
"label": "publish",
55+
"command": "dotnet",
56+
"type": "process",
57+
"args": [
58+
"publish",
59+
"${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebMVC/Dotnet6.GraphQL4.Store.WebMVC.csproj",
60+
"/property:GenerateFullPaths=true",
61+
"/consoleloggerparameters:NoSummary"
62+
],
63+
"problemMatcher": "$msCompile"
64+
},
65+
{
66+
"label": "watch",
67+
"command": "dotnet",
68+
"type": "process",
69+
"args": [
70+
"watch",
71+
"run",
72+
"${workspaceFolder}/src/Dotnet6.GraphQL4.Store.WebMVC/Dotnet6.GraphQL4.Store.WebMVC.csproj",
3673
"/property:GenerateFullPaths=true",
3774
"/consoleloggerparameters:NoSummary"
3875
],

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<Microsoft_HealthChecks_EntityFrameworkCore_Version>6.0.0-preview.3.21201.13</Microsoft_HealthChecks_EntityFrameworkCore_Version>
1717

1818
<!--GraphQL-->
19-
<GraphQL_Server_Version>5.0.1</GraphQL_Server_Version>
19+
<GraphQL_Server_Version>5.0.2</GraphQL_Server_Version>
2020
<GraphQL_Client_Version>3.2.3</GraphQL_Client_Version>
21-
<GraphQL_Version>4.3.0</GraphQL_Version>
21+
<GraphQL_Version>4.5.0</GraphQL_Version>
2222

2323
<!--AutoMapper-->
2424
<AutoMapper_DependencyInjection_Version>8.1.1</AutoMapper_DependencyInjection_Version>
@@ -31,7 +31,7 @@
3131
<HealthChecks_Version>5.0.1</HealthChecks_Version>
3232

3333
<!--Others-->
34-
<FluentValidation_Version>10.0.4</FluentValidation_Version>
34+
<FluentValidation_Version>10.1.0</FluentValidation_Version>
3535
<Scrutor_Version>3.3.0</Scrutor_Version>
3636

3737
</PropertyGroup>

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ This project exemplifies the implementation and **dockerization** of a simple Ra
2020

2121
---
2222

23+
![diagram](./.assets/img/diagram.png)
24+
25+
---
26+
2327
## Running
2428

2529
### Development (secrets)
@@ -171,27 +175,29 @@ networks:
171175
```
172176
### GraphQL Playground
173177
174-
By default **Playground** respond at `http://localhost:5000/ui/playground` but is possible configure the host and many others details in [`../....WebAPI/Graphs/Extensions/DependencyInjection/ApplicationBuilderExtensions.cs`](./src/Dotnet6.GraphQL4.Store.WebAPI/Graphs/Extensions/DependencyInjection/ApplicationBuilderExtensions.cs)
178+
By default **Playground** respond at `http://localhost:5000/ui/playground` but is possible configure the host and many others details in [`../DependencyInjection/Extensions/ApplicationBuilderExtensions.cs`](./src/Dotnet6.GraphQL4.Store.WebAPI/DependencyInjection/Extensions/ApplicationBuilderExtensions.cs)
175179

176180
```c#
177181
app.UseGraphQLPlayground(
178-
new GraphQLPlaygroundOptions
179-
{
180-
Path = "/ui/playground",
181-
BetaUpdates = true,
182-
RequestCredentials = RequestCredentials.Omit,
183-
HideTracingResponse = false,
184-
EditorCursorShape = EditorCursorShape.Line,
185-
EditorTheme = EditorTheme.Dark,
186-
EditorFontSize = 14,
187-
EditorReuseHeaders = true,
188-
EditorFontFamily = "JetBrains Mono"
189-
});
182+
options: new()
183+
{
184+
BetaUpdates = true,
185+
RequestCredentials = RequestCredentials.Omit,
186+
HideTracingResponse = false,
187+
EditorCursorShape = EditorCursorShape.Line,
188+
EditorTheme = EditorTheme.Dark,
189+
EditorFontSize = 14,
190+
EditorReuseHeaders = true,
191+
EditorFontFamily = "JetBrains Mono"
192+
},
193+
path: "/ui/playground");
190194
```
191195

192196
### Health checks
193197

194-
Based on cloud-native concepts, **Readiness** and **Liveness** integrity verification strategies were implemented.
198+
Based on cloud-native concepts, **Readiness** and **Liveness** integrity verification strategies were implemented.
199+
200+
If using [xabarilcoding/healthchecksui](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/doc/ui-docker.md) container image it will responde on `http://localhost:8000/healthchecks-ui/`.
195201

196202
> `/health`
197203
> Just check if the instance is running.
@@ -248,8 +254,8 @@ The implementation of the `UnitOfWork` gives support to the `ExecutionStrategy`
248254
```c#
249255
public Task<Review> AddReviewAsync(ReviewModel reviewModel, CancellationToken cancellationToken)
250256
{
251-
return UnitOfWork.ExecuteInTransactionAsync(
252-
operationAsync: async ct => // Func<CancellationToken, Task<TResult>>
257+
return UnitOfWork.ExecuteInTransactionScopeAsync(
258+
operationAsync: async ct =>
253259
{
254260
var product = await Repository.GetByIdAsync(
255261
id: reviewModel.ProductId,
@@ -262,8 +268,8 @@ public Task<Review> AddReviewAsync(ReviewModel reviewModel, CancellationToken ca
262268
await OnEditAsync(product, ct);
263269
return review;
264270
},
265-
condition: _ => NotificationContext.AllValidAsync, // Func<CancellationToken, Task<bool>>
266-
cancellationToken: cancellationToken);
271+
condition: _ => NotificationContext.AllValidAsync,
272+
cancellationToken: cancellationToken);
267273
}
268274
```
269275

src/Dotnet6.GraphQL4.Store.WebAPI/Graphs/StoreQuery.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public StoreQuery()
4343
.Name("Reviews")
4444
.Argument<GuidGraphType>("productId")
4545
.Resolve()
46-
.WithScope()
4746
.WithService<IProductService>()
4847
.ResolveAsync(
4948
async (context, service) =>

src/Dotnet6.GraphQL4.Store.WebAPI/Properties/launchSettings.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@
33
"windowsAuthentication": false,
44
"anonymousAuthentication": true,
55
"iisExpress": {
6-
"applicationUrl": "http://localhost:46086/",
7-
"sslPort": 44365
6+
"applicationUrl": "http://localhost:5000/"
87
}
98
},
109
"profiles": {
1110
"IIS Express": {
1211
"commandName": "IISExpress",
13-
"launchBrowser": false,
12+
"launchBrowser": true,
13+
"launchUrl": "ui/playground",
1414
"environmentVariables": {
1515
"ASPNETCORE_ENVIRONMENT": "Development"
1616
}
1717
},
1818
"Dotnet5.GraphQL.Store.WebAPI": {
1919
"commandName": "Project",
20-
"launchBrowser": false,
21-
"applicationUrl": "http://localhost:5000/",
20+
"launchBrowser": true,
21+
"applicationUrl": "http://localhost:5000",
22+
"launchUrl": "ui/playground",
2223
"environmentVariables": {
2324
"ASPNETCORE_ENVIRONMENT": "Development"
2425
}

src/Dotnet6.GraphQL4.Store.WebMVC/Clients/StoreGraphClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public async Task<IEnumerable<ReviewModel>> GetReviewByProductIdAsync(Guid id, C
8989
{
9090
var request = new GraphQLRequest
9191
{
92-
Query = @"query ReviewsByProductQuery($productId: ID!) {
92+
Query = @"query ReviewsByProductQuery($productId: Guid!) {
9393
reviews(productId: $productId) {
9494
id
9595
title

src/Dotnet6.GraphQL4.Store.WebMVC/Properties/launchSettings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"windowsAuthentication": false,
44
"anonymousAuthentication": true,
55
"iisExpress": {
6-
"applicationUrl": "http://localhost:48344/",
7-
"sslPort": 44359
6+
"applicationUrl": "http://localhost:7000"
87
}
98
},
109
"profiles": {
@@ -18,7 +17,7 @@
1817
"Dotnet5.GraphQL.Store.WebMVC": {
1918
"commandName": "Project",
2019
"launchBrowser": true,
21-
"applicationUrl": "http://localhost:7000/",
20+
"applicationUrl": "http://localhost:7000",
2221
"environmentVariables": {
2322
"ASPNETCORE_ENVIRONMENT": "Development"
2423
}

0 commit comments

Comments
 (0)