private static void DeserializeErrors(
     IQueryResultBuilder result,
     IReadOnlyDictionary <string, object> serializedResult)
 {
     if (serializedResult.TryGetValue(_errors, out object o) &&
         o is IReadOnlyList <object> l)
     {
         foreach (var error in l.OfType <IReadOnlyDictionary <string, object> >())
         {
             result.AddError(ErrorBuilder.FromDictionary(error).Build());
         }
     }
 }
Exemplo n.º 2
0
 private static void DeserializeErrors(
     IQueryResultBuilder result,
     IReadOnlyDictionary <string, object?> serializedResult)
 {
     if (serializedResult.TryGetValue(_errors, out object?o) &&
         o is ListValueNode l)
     {
         foreach (var error in l.Items.OfType <ObjectValueNode>())
         {
             Dictionary <string, object?> dict = _converter.Convert(error);
             result.AddError(ErrorBuilder.FromDictionary(dict).Build());
         }
     }
 }
Exemplo n.º 3
0
        private static void DeserializeErrors(
            IQueryResultBuilder result,
            IReadOnlyDictionary <string, object?> serializedResult)
        {
            if (serializedResult.TryGetValue(_errors, out object?o) &&
                o is IReadOnlyList <object> errors)
            {
                foreach (var obj in errors)
                {
                    IError error = ErrorBuilder
                                   .FromDictionary(DeserializeErrorObject(obj))
                                   .Build();

                    result.AddError(error);
                }
            }
        }