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(`| Name | Description |
|---|---|
| `,
`\n`,
`${arg.name}`,
` \n`, typeUrl ? ` ${arg.type.toJSON()}`
: `${arg.type.toJSON()}`,
`\n`,
` | `,
`\n`
);
lines.push(``, `\n`);
if (arg.deprecationReason) {
lines.push(
`Deprecated: ${escapeSpecialCharacters( arg.deprecationReason )}`, `\n\n` ); } lines.push(parseMarkdown(arg.description || ""), `\n`); lines.push(` | `, `\n`);
lines.push(`