tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
StringScalarType.cs
Go to the documentation of this file.
1using System;
2
3using HotChocolate.Language;
4using HotChocolate.Types;
5
7{
11 public abstract class StringScalarType : ScalarType<string, StringValueNode>
12 {
17 public StringScalarType(string name)
18 : base(name)
19 {
20 }
21
23 public override IValueNode ParseResult(object? resultValue)
24 => ParseValue(resultValue);
25
27 protected override string ParseLiteral(StringValueNode valueSyntax)
28 {
29 ArgumentNullException.ThrowIfNull(valueSyntax);
30 return valueSyntax.Value;
31 }
32
34 protected override StringValueNode ParseValue(string runtimeValue)
35 => new(runtimeValue);
36 }
37}
A ScalarType<TRuntimeType, TLiteral> for specialized string types.
override IValueNode ParseResult(object? resultValue)
StringScalarType(string name)
Initializes a new instance of the StringScalarType class.
override string ParseLiteral(StringValueNode valueSyntax)
override StringValueNode ParseValue(string runtimeValue)