public static void CompleteValue(
            Action <ResolverContext> enqueueNext,
            ResolverContext resolverContext)
        {
            CompleteValueContext completionContext = _completionContext.Value;

            completionContext.Clear();

            completionContext.EnqueueNext     = enqueueNext;
            completionContext.ResolverContext = resolverContext;

            CompleteValue(
                completionContext,
                resolverContext.Field.Type,
                resolverContext.Result);

            if (completionContext.IsViolatingNonNullType)
            {
                resolverContext.PropagateNonNullViolation.Invoke();
            }
            else
            {
                resolverContext.SetCompletedValue(completionContext.Value);
            }

            completionContext.Clear();
        }
Exemple #2
0
        public static void CompleteValue(
            this CompleteValueContext completionContext,
            ResolverContext resolverContext)
        {
            if (completionContext == null)
            {
                throw new ArgumentNullException(nameof(completionContext));
            }

            completionContext.ResolverContext = resolverContext;

            ValueCompletion.CompleteValue(
                completionContext,
                resolverContext.Field.Type,
                resolverContext.Result);

            if (completionContext.IsViolatingNonNullType)
            {
                resolverContext.PropagateNonNullViolation.Invoke();
            }
            else
            {
                resolverContext.SetCompletedValue(completionContext.Value);
            }
        }