(name: string)
| 118 | ); |
| 119 | |
| 120 | const scalarToJsonSchema = (name: string): Record<string, unknown> => |
| 121 | Match.value(name).pipe( |
| 122 | Match.whenOr("String", "ID", (): Record<string, unknown> => ({ type: "string" })), |
| 123 | Match.when("Int", (): Record<string, unknown> => ({ type: "integer" })), |
| 124 | Match.when("Float", (): Record<string, unknown> => ({ type: "number" })), |
| 125 | Match.when("Boolean", (): Record<string, unknown> => ({ type: "boolean" })), |
| 126 | Match.option, |
| 127 | Option.getOrElse( |
| 128 | (): Record<string, unknown> => ({ type: "string", description: `Custom scalar: ${name}` }), |
| 129 | ), |
| 130 | ); |
| 131 | |
| 132 | // --------------------------------------------------------------------------- |
| 133 | // Build input JSON Schema from field arguments |
no outgoing calls
no test coverage detected