Пример #1
0
        public static IStitchingBuilder RenameField(
            this IStitchingBuilder builder,
            NameString schemaName,
            FieldReference field,
            NameString argumentName,
            NameString newArgumentName)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            schemaName.EnsureNotEmpty(nameof(schemaName));
            argumentName.EnsureNotEmpty(nameof(argumentName));
            newArgumentName.EnsureNotEmpty(nameof(newArgumentName));

            return(builder.AddTypeRewriter(
                       new RenameFieldArgumentRewriter(
                           schemaName,
                           field,
                           argumentName,
                           newArgumentName)));
        }
Пример #2
0
        public static IStitchingBuilder AddTypeRewriter(
            this IStitchingBuilder builder,
            RewriteTypeDefinitionDelegate rewrite)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (rewrite == null)
            {
                throw new ArgumentNullException(nameof(rewrite));
            }

            return(builder.AddTypeRewriter(new DelegateTypeRewriter(rewrite)));
        }
Пример #3
0
        public static IStitchingBuilder RenameType(
            this IStitchingBuilder builder,
            NameString originalTypeName,
            NameString newTypeName)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            originalTypeName.EnsureNotEmpty(nameof(originalTypeName));
            newTypeName.EnsureNotEmpty(nameof(newTypeName));

            return(builder.AddTypeRewriter(
                       new RenameTypeRewriter(originalTypeName, newTypeName)));
        }