This repository was archived by the owner on Jul 18, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathRootSchemaObject.cs
More file actions
86 lines (76 loc) · 2.1 KB
/
RootSchemaObject.cs
File metadata and controls
86 lines (76 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;
namespace GraphQLinq.Scaffolding
{
public class RootSchemaObject
{
public Data Data { get; set; }
}
public class Data
{
[JsonPropertyName("__schema")]
public Schema Schema { get; set; }
}
public class Schema
{
public List<GraphqlType> Types { get; set; }
public GraphqlType QueryType { get; set; }
public GraphqlType MutationType { get; set; }
public GraphqlType? SubscriptionType { get; set; }
}
public class GraphqlType : BaseInfo
{
public TypeKind Kind { get; set; }
public List<EnumValue> EnumValues { get; set; }
public List<Field> Fields { get; set; }
public List<Field> InputFields { get; set; }
public List<GraphqlType> Interfaces { get; set; }
}
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum TypeKind
{
[EnumMember(Value = "LIST")]
List,
[EnumMember(Value = "NON_NULL")]
NonNull,
[EnumMember(Value = "SCALAR")]
Scalar,
[EnumMember(Value = "OBJECT")]
Object,
[EnumMember(Value = "INTERFACE")]
Interface,
[EnumMember(Value = "UNION")]
Union,
[EnumMember(Value = "ENUM")]
Enum,
[EnumMember(Value = "INPUT_OBJECT")]
InputObject
}
public class EnumValue
{
public string Name { get; set; }
}
public class Field : BaseInfo
{
public FieldType Type { get; set; }
public List<Arg> Args { get; set; }
}
public class FieldType
{
public TypeKind Kind { get; set; }
public string? Name { get; set; }
public FieldType? OfType { get; set; }
}
public class Arg : BaseInfo
{
public FieldType Type { get; set; }
}
[DebuggerDisplay("Name = {" + nameof(Name) + "}")]
public class BaseInfo
{
public string Name { get; set; }
public string Description { get; set; }
}
}