Esempio n. 1
0
        /// <summary>
        /// Merges the specified configuration setttings into this instance.
        /// </summary>
        /// <param name="config">The configuration.</param>
        public void Merge(ISchemaExecutionConfiguration config)
        {
            if (config == null)
                return;

            this.EnableMetrics = config.EnableMetrics;
            this.QueryTimeout = config.QueryTimeout;
            this.AwaitEachRequestedField = config.AwaitEachRequestedField;
            this.MaxQueryDepth = config.MaxQueryDepth;
            this.MaxQueryComplexity = config.MaxQueryComplexity;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SchemaConfiguration" /> class.
        /// </summary>
        /// <param name="declarationOptions">The declaration options to build the configuration with.</param>
        /// <param name="executionOptions">The execution options to build the configuration with.</param>
        /// <param name="responseOptions">The response options to build the configuration with.</param>
        /// <param name="cacheOptions">The cache options to build this configuration with.</param>
        public SchemaConfiguration(
            ISchemaDeclarationConfiguration declarationOptions = null,
            ISchemaExecutionConfiguration executionOptions     = null,
            ISchemaResponseConfiguration responseOptions       = null,
            ISchemaQueryPlanCacheConfiguration cacheOptions    = null)
        {
            _declarationOptions = new SchemaDeclarationConfiguration();
            _executionOptions   = new SchemaExecutionConfiguration();
            _responseOptions    = new SchemaResponseConfiguration();
            _cacheOptions       = new SchemaQueryPlanCacheConfiguration();

            _declarationOptions.Merge(declarationOptions);
            _executionOptions.Merge(executionOptions);
            _responseOptions.Merge(responseOptions);
            _cacheOptions.Merge(cacheOptions);
        }