mirror of https://github.com/Squidex/squidex.git
6 changed files with 102 additions and 27 deletions
@ -0,0 +1,31 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using GraphQL; |
||||
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL; |
||||
|
using Squidex.Infrastructure.Reflection; |
||||
|
|
||||
|
namespace Squidex.Areas.Api.Controllers.Contents.Models |
||||
|
{ |
||||
|
public class GraphQLGetDto |
||||
|
{ |
||||
|
public string OperationName { get; set; } |
||||
|
|
||||
|
public string Query { get; set; } |
||||
|
|
||||
|
public string Variables { get; set; } |
||||
|
|
||||
|
public GraphQLQuery ToQuery() |
||||
|
{ |
||||
|
var query = SimpleMapper.Map(this, new GraphQLQuery()); |
||||
|
|
||||
|
query.Inputs = Variables?.ToInputs(); |
||||
|
|
||||
|
return query; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
||||
|
// All rights reserved. Licensed under the MIT license.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using GraphQL; |
||||
|
using Newtonsoft.Json.Linq; |
||||
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL; |
||||
|
using Squidex.Infrastructure.Reflection; |
||||
|
|
||||
|
namespace Squidex.Areas.Api.Controllers.Contents.Models |
||||
|
{ |
||||
|
public class GraphQLPostDto |
||||
|
{ |
||||
|
public string OperationName { get; set; } |
||||
|
|
||||
|
public string Query { get; set; } |
||||
|
|
||||
|
public JObject Variables { get; set; } |
||||
|
|
||||
|
public GraphQLQuery ToQuery() |
||||
|
{ |
||||
|
var query = SimpleMapper.Map(this, new GraphQLQuery()); |
||||
|
|
||||
|
query.Inputs = Variables?.ToInputs(); |
||||
|
|
||||
|
return query; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue