-
Notifications
You must be signed in to change notification settings - Fork 238
/
Copy pathGraphQLRuntimeOptions.cs
34 lines (29 loc) · 1.52 KB
/
GraphQLRuntimeOptions.cs
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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
namespace Azure.DataApiBuilder.Config.ObjectModel;
public record GraphQLRuntimeOptions(bool Enabled = true,
string Path = GraphQLRuntimeOptions.DEFAULT_PATH,
bool AllowIntrospection = true,
int? DepthLimit = null,
MultipleMutationOptions? MultipleMutationOptions = null,
bool EnableAggregation = true,
FeatureFlags? FeatureFlags = null)
{
public const string DEFAULT_PATH = "/graphql";
/// <summary>
/// Flag which informs CLI and JSON serializer whether to write depth-limit
/// property and value to the runtime config file.
/// When user doesn't provide the depth-limit property/value, which signals DAB to use the default,
/// the DAB CLI should not write the default value to a serialized config.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.Always)]
[MemberNotNullWhen(true, nameof(DepthLimit))]
public bool UserProvidedDepthLimit { get; init; } = false;
/// <summary>
/// Feature flag contains ephemeral flags passed in to init the runtime options
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.Always)]
public FeatureFlags FeatureFlags { get; init; } = FeatureFlags ?? new FeatureFlags();
}