protected static async Task <object> ExecuteResolverAsync(
            ResolverTask resolverTask,
            CancellationToken cancellationToken)
        {
            Activity activity = ResolverDiagnosticEvents.BeginResolveField(
                resolverTask.ResolverContext);

            object result = await ExecuteMiddlewareAsync(
                resolverTask,
                cancellationToken);

            if (result is IQueryError error)
            {
                activity?.AddTag("error", "true");
            }

            ResolverDiagnosticEvents.EndResolveField(
                activity,
                resolverTask.ResolverContext,
                result);

            return(result);
        }
Пример #2
0
        protected static async Task <object> ExecuteResolverAsync(
            ResolverTask resolverTask,
            IErrorHandler errorHandler,
            CancellationToken cancellationToken)
        {
            Activity activity = ResolverDiagnosticEvents.BeginResolveField(
                resolverTask.ResolverContext);

            object result = await ExecuteMiddlewareAsync(
                resolverTask, errorHandler).ConfigureAwait(false);

            if (result is IError || result is IEnumerable <IError> )
            {
                activity?.AddTag("error", "true");
            }

            ResolverDiagnosticEvents.EndResolveField(
                activity,
                resolverTask.ResolverContext,
                result);

            return(result);
        }