Skip to content

Commit 543e38e

Browse files
Merge pull request #169 from AntonioFalcao/feature/graphql-4
Feature/graphql 4
2 parents faac5cd + 96c8fe7 commit 543e38e

218 files changed

Lines changed: 46416 additions & 46411 deletions

File tree

Some content is hidden

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

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup .NET Core
1414
uses: actions/setup-dotnet@v1
1515
with:
16-
dotnet-version: 5.0.100
16+
dotnet-version: 6.0.100-preview.2.21155.3
1717
- name: Install dependencies
1818
run: dotnet restore -v m
1919
- name: Build
@@ -28,6 +28,6 @@ jobs:
2828
- name: Setup .NET Core
2929
uses: actions/setup-dotnet@v1
3030
with:
31-
dotnet-version: 5.0.100
31+
dotnet-version: 6.0.100-preview.2.21155.3
3232
- name: Test
3333
run: dotnet test --no-restore -v m

.github/workflows/webapi-docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Build the Docker image
14-
run: docker build . --file ./src/Dotnet5.GraphQL3.Store.WebAPI/Dockerfile --tag my-image-name:$(date +%s)
14+
run: docker build . --file ./src/Dotnet6.GraphQL4.Store.WebAPI/Dockerfile --tag my-image-name:$(date +%s)

.github/workflows/webapi-docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ jobs:
3030
uses: docker/build-push-action@v2
3131
with:
3232
context: .
33-
file: ./src/Dotnet5.GraphQL3.Store.WebAPI/Dockerfile
33+
file: ./src/Dotnet6.GraphQL4.Store.WebAPI/Dockerfile
3434
push: true
3535
tags: antoniofalcaojr/dotnet5-graphql3-webapi:latest

.github/workflows/webmvc-docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Build the Docker image
14-
run: docker build . --file ./src/Dotnet5.GraphQL3.Store.WebMVC/Dockerfile --tag my-image-name:$(date +%s)
14+
run: docker build . --file ./src/Dotnet6.GraphQL4.Store.WebMVC/Dockerfile --tag my-image-name:$(date +%s)

.github/workflows/webmvc-docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
uses: docker/build-push-action@v2
3030
with:
3131
context: .
32-
file: ./src/Dotnet5.GraphQL3.Store.WebMVC/Dockerfile
32+
file: ./src/Dotnet6.GraphQL4.Store.WebMVC/Dockerfile
3333
push: true
3434
tags: antoniofalcaojr/dotnet5-graphql3-webmvc:latest

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup Label="Common properties">
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<LangVersion>9</LangVersion>
66
</PropertyGroup>
77

Lines changed: 159 additions & 159 deletions
Large diffs are not rendered by default.

NuGet.Config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
<configuration>
33
<packageSources>
44
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5-
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
65
</packageSources>
76
</configuration>

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Dotnet5.GraphQL3.WebApplication
1+
# Dotnet6.GraphQL4.WebApplication
22

3-
This project exemplify the implementation and **dockerization** of a simple Razor Web MVC Core consuming a full **GraphQL 3** Web API, build in a **.NET 5** multi-layer project, considering development best practices, like **SOLID**, **KISS** and **DRY**, applying **Domain-Driven** concepts in a **Hexagonal Architecture**.
3+
This project exemplify the implementation and **dockerization** of a simple Razor Web MVC Core consuming a full **GraphQL 4** Web API, build in a **.NET 6** multi-layer project, considering development best practices, like **SOLID**, **KISS** and **DRY**, applying **Domain-Driven** concepts in a **Hexagonal Architecture**.
44

55
### Give a Star! :star:
66

77
|WebAPI|
88
|:----:|
9-
|[![Build/Test](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/workflows/Build/Test/badge.svg)](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/actions/workflows/build-and-test.yml) [![API Image](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/workflows/API%20Image/badge.svg)](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/actions/workflows/build-and-test.yml) [![Push API](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/workflows/Push%20API/badge.svg?branch=master)](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/actions/workflows/webapi-docker-publish.yml) [![CodeQL](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/workflows/CodeQL/badge.svg)](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/actions/workflows/codeql-analysis.yml) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/35ba87f59d524982baeb803a3a9c42f7)](https://www.codacy.com/gh/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=AntonioFalcao/Dotnet5.GraphQL3.WebApplication&amp;utm_campaign=Badge_Grade) [![](https://img.shields.io/docker/pulls/antoniofalcaojr/dotnet5-graphql3-webapi?style=flat)](https://hub.docker.com/repository/docker/antoniofalcaojr/dotnet5-graphql3-webapi)|
9+
|[![Build/Test](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/workflows/Build/Test/badge.svg)](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/actions/workflows/build-and-test.yml) [![API Image](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/workflows/API%20Image/badge.svg)](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/actions/workflows/build-and-test.yml) [![Push API](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/workflows/Push%20API/badge.svg?branch=master)](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/actions/workflows/webapi-docker-publish.yml) [![CodeQL](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/workflows/CodeQL/badge.svg)](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/actions/workflows/codeql-analysis.yml) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/35ba87f59d524982baeb803a3a9c42f7)](https://www.codacy.com/gh/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=AntonioFalcao/Dotnet6.GraphQL4.WebApplication&amp;utm_campaign=Badge_Grade) [![](https://img.shields.io/docker/pulls/antoniofalcaojr/Dotnet6-GraphQL4-webapi?style=flat)](https://hub.docker.com/repository/docker/antoniofalcaojr/Dotnet6-GraphQL4-webapi)|
1010
|**WebMVC**|
11-
|[![Build/Test](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/workflows/Build/Test/badge.svg)](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/actions/workflows/build-and-test.yml) [![MVC Image](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/workflows/MVC%20Image/badge.svg)](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/actions/workflows/webmvc-docker-image.yml) [![Push MVC](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/workflows/Push%20MVC/badge.svg?branch=master)](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/actions/workflows/webmvc-docker-publish.yml) [![CodeQL](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/workflows/CodeQL/badge.svg)](https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/actions/workflows/codeql-analysis.yml) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/35ba87f59d524982baeb803a3a9c42f7)](https://www.codacy.com/gh/AntonioFalcao/Dotnet5.GraphQL3.WebApplication/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=AntonioFalcao/Dotnet5.GraphQL3.WebApplication&amp;utm_campaign=Badge_Grade) [![](https://img.shields.io/docker/pulls/antoniofalcaojr/dotnet5-graphql3-webmvc?style=flat)](https://hub.docker.com/repository/docker/antoniofalcaojr/dotnet5-graphql3-webmvc)|
11+
|[![Build/Test](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/workflows/Build/Test/badge.svg)](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/actions/workflows/build-and-test.yml) [![MVC Image](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/workflows/MVC%20Image/badge.svg)](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/actions/workflows/webmvc-docker-image.yml) [![Push MVC](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/workflows/Push%20MVC/badge.svg?branch=master)](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/actions/workflows/webmvc-docker-publish.yml) [![CodeQL](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/workflows/CodeQL/badge.svg)](https://github.com/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/actions/workflows/codeql-analysis.yml) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/35ba87f59d524982baeb803a3a9c42f7)](https://www.codacy.com/gh/AntonioFalcao/Dotnet6.GraphQL4.WebApplication/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=AntonioFalcao/Dotnet6.GraphQL4.WebApplication&amp;utm_campaign=Badge_Grade) [![](https://img.shields.io/docker/pulls/antoniofalcaojr/Dotnet6-GraphQL4-webmvc?style=flat)](https://hub.docker.com/repository/docker/antoniofalcaojr/Dotnet6-GraphQL4-webmvc)|
1212

1313
![home](./.assets/img/home.PNG)
1414

@@ -18,14 +18,14 @@ This project exemplify the implementation and **dockerization** of a simple Razo
1818

1919
##### Secrets
2020

21-
To configure database resource, `init` secrets in [`./src/Dotnet5.GraphQL3.Store.WebAPI`](./src/Dotnet5.GraphQL3.Store.WebAPI), and then define the `DefaultConnection`:
21+
To configure database resource, `init` secrets in [`./src/Dotnet6.GraphQL4.Store.WebAPI`](./src/Dotnet6.GraphQL4.Store.WebAPI), and then define the `DefaultConnection`:
2222

2323
```bash
2424
dotnet user-secrets init
2525
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=localhost,1433;Database=Store;User=sa;Password=!MyComplexPassword"
2626
```
2727

28-
After this, to configure the HTTP client, `init` secrets in [`./src/Dotnet5.GraphQL3.Store.WebMVC`](./src/Dotnet5.GraphQL3.Store.WebMVC) and define **Store** client host:
28+
After this, to configure the HTTP client, `init` secrets in [`./src/Dotnet6.GraphQL4.Store.WebMVC`](./src/Dotnet6.GraphQL4.Store.WebMVC) and define **Store** client host:
2929

3030
```bash
3131
dotnet user-secrets init
@@ -34,7 +34,7 @@ dotnet user-secrets set "HttpClient:Store" "http://localhost:5000"
3434

3535
##### AppSettings
3636

37-
If you prefer, is possible to define it on WebAPI [`appsettings.Development.json`](./src/Dotnet5.GraphQL3.Store.WebAPI/appsettings.Development.json) and WebMVC [`appsettings.Development.json`](./src/Dotnet5.GraphQL3.Store.WebMVC/appsettings.Development.json) files:
37+
If you prefer, is possible to define it on WebAPI [`appsettings.Development.json`](./src/Dotnet6.GraphQL4.Store.WebAPI/appsettings.Development.json) and WebMVC [`appsettings.Development.json`](./src/Dotnet6.GraphQL4.Store.WebMVC/appsettings.Development.json) files:
3838

3939
WebAPI
4040

@@ -59,7 +59,7 @@ ___
5959

6060
### Production
6161

62-
Considering use Docker for CD (Continuous Deployment). On respective [compose](./docker-compose.yml) both web applications and sql server are in the same network, and then we can use named hosts. Already defined on WebAPI [`appsettings.json`](./src/Dotnet5.GraphQL3.Store.WebAPI/appsettings.json) and WebMVC [`appsettings.json`](./src/Dotnet5.GraphQL3.Store.WebMVC/appsettings.json) files:
62+
Considering use Docker for CD (Continuous Deployment). On respective [compose](./docker-compose.yml) both web applications and sql server are in the same network, and then we can use named hosts. Already defined on WebAPI [`appsettings.json`](./src/Dotnet6.GraphQL4.Store.WebAPI/appsettings.json) and WebMVC [`appsettings.json`](./src/Dotnet6.GraphQL4.Store.WebMVC/appsettings.json) files:
6363

6464
##### AppSettings
6565

@@ -88,7 +88,7 @@ ___
8888

8989
### Notifications (pattern/context)
9090

91-
To avoid handle exceptions, was implemented a [`NotificationContext`](./src/Dotnet5.GraphQL3.CrossCutting/Notifications/NotificationContext.cs) that's allow all layers add business notifications through the request, with support to receive **Domain** notifications, that by other side, implementing validators from **Fluent Validation** and return a `ValidationResult`.
91+
To avoid handle exceptions, was implemented a [`NotificationContext`](./src/Dotnet6.GraphQL4.CrossCutting/Notifications/NotificationContext.cs) that's allow all layers add business notifications through the request, with support to receive **Domain** notifications, that by other side, implementing validators from **Fluent Validation** and return a `ValidationResult`.
9292

9393
```c#
9494
protected bool OnValidate<TEntity>(TEntity entity, AbstractValidator<TEntity> validator)
@@ -104,7 +104,7 @@ protected void AddError(string errorMessage, ValidationResult validationResult =
104104
}
105105
```
106106

107-
To the **GraphQL** the notification context delivery a `ExecutionErrors` that is propagated to `result` from execution by a personalised [`Executer`](./src/Dotnet5.GraphQL3.Store.WebAPI/GraphQL/Executers/StoreExecuter.cs):
107+
To the **GraphQL** the notification context delivery a `ExecutionErrors` that is propagated to `result` from execution by a personalised [`Executer`](./src/Dotnet6.GraphQL4.Store.WebAPI/GraphQL/Executers/StoreExecuter.cs):
108108

109109
```c#
110110
public override async Task<ExecutionResult> ExecuteAsync(string operationName, string query, Inputs variables, IDictionary<string, object> context, IServiceProvider requestServices, CancellationToken cancellationToken = new CancellationToken())
@@ -125,7 +125,7 @@ public override async Task<ExecutionResult> ExecuteAsync(string operationName, s
125125

126126
_It's no more necessary after version 4.2.0 from **GraphQL Server**. By default, the Service Provider is already being propagated._
127127

128-
~~Is necessary, in the same personalised [`Executer`](./src/Dotnet5.GraphQL3.Store.WebAPI/GraphQL/Executers/StoreExecuter.cs) define the _service provider_ that will be used from `resolvers` on `fields`:~~
128+
~~Is necessary, in the same personalised [`Executer`](./src/Dotnet6.GraphQL4.Store.WebAPI/GraphQL/Executers/StoreExecuter.cs) define the _service provider_ that will be used from `resolvers` on `fields`:~~
129129

130130
```c#
131131
var options = base.GetOptions(operationName, query, variables, context, cancellationToken);
@@ -136,7 +136,7 @@ options.RequestServices = _serviceProvider;
136136

137137
With abstract designs, it is possible to reduce coupling in addition to applying **DRY** concepts, providing resources for the main behaviors:
138138

139-
[`...Domain.Abstractions`](./src/Dotnet5.GraphQL3.Domain.Abstractions)
139+
[`...Domain.Abstractions`](./src/Dotnet6.GraphQL4.Domain.Abstractions)
140140

141141
```c#
142142
public abstract class Entity<TId>
@@ -150,7 +150,7 @@ public abstract class Builder<TBuilder, TEntity, TId> : IBuilder<TEntity, TId>
150150
where TId : struct
151151
```
152152

153-
[`...Repositories.Abstractions`](./src/Dotnet5.GraphQL3.Repositories.Abstractions/Repository.cs)
153+
[`...Repositories.Abstractions`](./src/Dotnet6.GraphQL4.Repositories.Abstractions/Repository.cs)
154154

155155
```c#
156156
public abstract class Repository<TEntity, TId> : IRepository<TEntity, TId>
@@ -165,7 +165,7 @@ public abstract class Repository<TEntity, TId> : IRepository<TEntity, TId>
165165
}
166166
```
167167

168-
[`...Services.Abstractions`](./src/Dotnet5.GraphQL3.Services.Abstractions/Service.cs)
168+
[`...Services.Abstractions`](./src/Dotnet6.GraphQL4.Services.Abstractions/Service.cs)
169169

170170
```c#
171171
public abstract class Service<TEntity, TModel, TId> : IService<TEntity, TModel, TId>
@@ -310,7 +310,7 @@ services:
310310

311311
webapi:
312312
container_name: webapi
313-
image: antoniofalcaojr/dotnet5-graphql3-webapi
313+
image: antoniofalcaojr/Dotnet6-GraphQL4-webapi
314314
environment:
315315
- ASPNETCORE_URLS=http://*:5000
316316
ports:
@@ -323,7 +323,7 @@ services:
323323

324324
webmvc:
325325
container_name: webmvc
326-
image: antoniofalcaojr/dotnet5-graphql3-webmvc
326+
image: antoniofalcaojr/Dotnet6-GraphQL4-webmvc
327327
environment:
328328
- ASPNETCORE_URLS=http://*:7000
329329
ports:
@@ -366,7 +366,7 @@ Web MVC
366366

367367
### GraphQL Playground
368368

369-
By default **Playground** respond at `http://localhost:5000/ui/playground` but is possible configure the host and many others details in [`../...WebAPI/GraphQL/DependencyInjection/Configure.cs`](./src/Dotnet5.GraphQL3.Store.WebAPI/GraphQL/DependencyInjection/Configure.cs)
369+
By default **Playground** respond at `http://localhost:5000/ui/playground` but is possible configure the host and many others details in [`../...WebAPI/GraphQL/DependencyInjection/Configure.cs`](./src/Dotnet6.GraphQL4.Store.WebAPI/GraphQL/DependencyInjection/Configure.cs)
370370

371371
```c#
372372
app.UseGraphQLPlayground(
@@ -672,11 +672,11 @@ Available soon!
672672

673673
## Versioning
674674

675-
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/AntonioFalcao/Dotnet5.GraphQL.WebApplication/tags).
675+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/AntonioFalcao/Dotnet6.GraphQL.WebApplication/tags).
676676
677677
## Authors
678678

679-
> See the list of [contributors](https://github.com/AntonioFalcao/Dotnet5.GraphQL.WebApplication/graphs/contributors) who participated in this project.
679+
> See the list of [contributors](https://github.com/AntonioFalcao/Dotnet6.GraphQL.WebApplication/graphs/contributors) who participated in this project.
680680

681681
## License
682682

global.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{
2-
"sdk": {
3-
"version": "5.0.100"
4-
}
5-
}
1+
{
2+
"sdk": {
3+
"version": "6.0.100-preview.2.21155.3"
4+
}
5+
}

0 commit comments

Comments
 (0)