Modification
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
51fbfa7563
commit
a14e6ffc0f
@ -0,0 +1,28 @@
|
||||
{
|
||||
"Routes": [
|
||||
{
|
||||
"DownstreamPathTemplate": "/api/joueur",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5001
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/rest/joueur",
|
||||
"UpstreamHttpMethod": [ "Get", "Post" ]
|
||||
},
|
||||
{
|
||||
"DownstreamPathTemplate": "/graphql",
|
||||
"DownstreamScheme": "http",
|
||||
"DownstreamHostAndPorts": [
|
||||
{
|
||||
"Host": "localhost",
|
||||
"Port": 5002
|
||||
}
|
||||
],
|
||||
"UpstreamPathTemplate": "/graphql",
|
||||
"UpstreamHttpMethod": [ "get" ]
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using DTOs;
|
||||
|
||||
namespace GraphQL_Project.Data;
|
||||
|
||||
public class JoueurAddedPayload
|
||||
{
|
||||
public JoueurDTO Joueur { get; }
|
||||
|
||||
public JoueurAddedPayload(JoueurDTO joueur)
|
||||
{
|
||||
Joueur = joueur ?? throw new ArgumentNullException(nameof(joueur));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using BowlingService.Interfaces;
|
||||
using DTOs;
|
||||
using GraphQL_Project.Record;
|
||||
|
||||
namespace GraphQL_Project.Data;
|
||||
|
||||
public class Mutation
|
||||
{
|
||||
public async Task<JoueurAddedPayload> AddjoueurAsync(AddJoueurInput input, [Service] IJoueurService joueurService)
|
||||
{
|
||||
JoueurDTO joueurDto = new JoueurDTO
|
||||
{
|
||||
Pseudo = input.Pseudo
|
||||
};
|
||||
var result = await joueurService.Add(joueurDto);
|
||||
return new JoueurAddedPayload(result);
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
namespace GraphQL_Project.Record;
|
||||
|
||||
public record AddJoueurInput(string Pseudo);
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue