mirror of https://github.com/Squidex/squidex.git
4 changed files with 5 additions and 80 deletions
@ -1,37 +0,0 @@ |
|||||
// ==========================================================================
|
|
||||
// GeolocationScalarType.cs
|
|
||||
// Squidex Headless CMS
|
|
||||
// ==========================================================================
|
|
||||
// Copyright (c) Squidex Group
|
|
||||
// All rights reserved.
|
|
||||
// ==========================================================================
|
|
||||
|
|
||||
using GraphQL.Language.AST; |
|
||||
using GraphQL.Types; |
|
||||
using Newtonsoft.Json.Linq; |
|
||||
|
|
||||
namespace Squidex.Domain.Apps.Read.Contents.GraphQL.Types |
|
||||
{ |
|
||||
public sealed class GeolocationScalarType : ScalarGraphType |
|
||||
{ |
|
||||
public GeolocationScalarType() |
|
||||
{ |
|
||||
Name = "Json"; |
|
||||
} |
|
||||
|
|
||||
public override object Serialize(object value) |
|
||||
{ |
|
||||
return value; |
|
||||
} |
|
||||
|
|
||||
public override object ParseValue(object value) |
|
||||
{ |
|
||||
return value != null ? value is JObject ? value : JObject.FromObject(value) : null; |
|
||||
} |
|
||||
|
|
||||
public override object ParseLiteral(IValue value) |
|
||||
{ |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,37 +0,0 @@ |
|||||
// ==========================================================================
|
|
||||
// JsonScalarType.cs
|
|
||||
// Squidex Headless CMS
|
|
||||
// ==========================================================================
|
|
||||
// Copyright (c) Squidex Group
|
|
||||
// All rights reserved.
|
|
||||
// ==========================================================================
|
|
||||
|
|
||||
using GraphQL.Language.AST; |
|
||||
using GraphQL.Types; |
|
||||
using Newtonsoft.Json.Linq; |
|
||||
|
|
||||
namespace Squidex.Domain.Apps.Read.Contents.GraphQL.Types |
|
||||
{ |
|
||||
public sealed class JsonScalarType : ScalarGraphType |
|
||||
{ |
|
||||
public JsonScalarType() |
|
||||
{ |
|
||||
Name = "Json"; |
|
||||
} |
|
||||
|
|
||||
public override object Serialize(object value) |
|
||||
{ |
|
||||
return value; |
|
||||
} |
|
||||
|
|
||||
public override object ParseValue(object value) |
|
||||
{ |
|
||||
return value != null ? value is JObject ? value : JObject.FromObject(value) : null; |
|
||||
} |
|
||||
|
|
||||
public override object ParseLiteral(IValue value) |
|
||||
{ |
|
||||
return null; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue