INNER CODE UNIT · TypeScript
getFieldType
stepci/garph · src/schema.ts:27
export function getFieldType(schemaComposer: SchemaComposer, type: AnyType, config: ConverterConfig) {
switch (type.typeDef.type) {
case 'String':
return isOptional('String', type, config)
case 'Int':
return isOptional('Int', type, config)
case 'Float':
return isOptional('Float', type, config)
case 'Boolean':
return isOptional('Boolean', type, config)
case 'ID':
return isOptional('ID', type, config)
case 'List':
return isOptional(`[${getFieldType(schemaComposer, type.typeDef.shape, config)}]`, type, config)
case 'PaginatedList':
schemaComposer.createObjectTC({
name: `${type.typeDef.shape.typeDef.shape.typeDef.name}Edge`,
fields: {