Ejemplo n.º 1
0
        public string NameFor(string field, Type parentType)
        {
            var attributes = parentType?.GetCustomAttributes(typeof(GraphQLFieldNameAttribute), true);

            if (attributes == null)
            {
                return(_defaultConverter.NameFor(field, parentType));
            }

            foreach (GraphQLFieldNameAttribute attribute in attributes)
            {
                if (attribute.Field == field)
                {
                    return(attribute.Mapped);
                }
            }

            return(_defaultConverter.NameFor(field, parentType));
        }