Esempio n. 1
0
        public static void CompleteValue(
            this CompleteValueContext context,
            ResolverTask resolverTask)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            context.ResolverTask = resolverTask;

            ValueCompletion.CompleteValue(
                context,
                resolverTask.FieldType,
                resolverTask.ResolverResult);

            if (context.IsViolatingNonNullType)
            {
                resolverTask.PropagateNonNullViolation();
            }
            else
            {
                resolverTask.SetResult(context.Value);
            }
        }
Esempio n. 2
0
        public void PropagateNonNullViolation()
        {
            if (FieldSelection.Field.Type.IsNonNullType())
            {
                if (_propagateNonNullViolation != null)
                {
                    _propagateNonNullViolation.Invoke();
                }
                else if (_parent != null)
                {
                    _parent.PropagateNonNullViolation();
                }
            }

            SetResult(null);
        }