import { type GraphQLArgument, type GraphQLInputField } from "graphql"; import type { MarkdownConverterOptions } from "../types"; import { escapeSpecialCharacters, parseMarkdown } from "./parseMarkdown"; export function pushArguments( lines: string[], args: readonly GraphQLArgument[] | GraphQLInputField[], options: MarkdownConverterOptions ): void { lines.push( `

Arguments

`, `\n\n` ); lines.push(``, `\n`); lines.push(``, `\n`); lines.push(``, `\n`); args.forEach((arg) => { lines.push(``, `\n`); const typeUrl = options.getTypePath(arg.type); lines.push( ``, `\n` ); lines.push(``, `\n`); lines.push(``, `\n`); }); lines.push(``, `\n`); lines.push(`
NameDescription
`, `\n`, `${arg.name}`, `
\n`, typeUrl ? `${arg.type.toJSON()}` : `${arg.type.toJSON()}`, `\n`, `
`, `\n`); if (arg.deprecationReason) { lines.push( `
Deprecated: ${escapeSpecialCharacters( arg.deprecationReason )}
`, `\n\n` ); } lines.push(parseMarkdown(arg.description || ""), `\n`); lines.push(`
`, `\n\n`); }