private static IReadOnlyCollection <Delegation.VariableValue> CreateVariableValues(
            IMiddlewareContext context,
            NameString schemaName,
            IEnumerable <Delegation.VariableValue> scopedVariables,
            ExtractedField extractedField,
            ExtractFieldQuerySyntaxRewriter rewriter)
        {
            var values = new Dictionary <string, Delegation.VariableValue>();

            foreach (Delegation.VariableValue value in scopedVariables)
            {
                values[value.Name] = value;
            }

            IReadOnlyDictionary <string, IValueNode> requestVariables = context.GetVariables();

            foreach (Delegation.VariableValue value in ResolveUsedRequestVariables(
                         context.Schema, schemaName, extractedField,
                         requestVariables, rewriter))
            {
                values[value.Name] = value;
            }

            return(values.Values);
        }
Пример #2
0
        private static IReadOnlyCollection <VariableValue> CreateVariableValues(
            IMiddlewareContext context,
            IEnumerable <VariableValue> scopedVaribles,
            ExtractedField extractedField)
        {
            var values = new Dictionary <string, VariableValue>();

            foreach (VariableValue value in scopedVaribles)
            {
                values[value.Name] = value;
            }

            IReadOnlyDictionary <string, object> requestVariables =
                context.GetVariables();

            foreach (VariableValue value in ResolveUsedRequestVariables(
                         extractedField, requestVariables))
            {
                values[value.Name] = value;
            }

            return(values.Values);
        }