(schema: GraphQLSchema, typeName: string)
| 439 | } |
| 440 | |
| 441 | function getTypeSpecifiers(schema: GraphQLSchema, typeName: string): Array<MapperKind> { |
| 442 | const type = schema.getType(typeName); |
| 443 | const specifiers = [MapperKind.TYPE]; |
| 444 | |
| 445 | if (isObjectType(type)) { |
| 446 | specifiers.push(MapperKind.COMPOSITE_TYPE, MapperKind.OBJECT_TYPE); |
| 447 | if (typeName === schema.getQueryType()?.name) { |
| 448 | specifiers.push(MapperKind.ROOT_OBJECT, MapperKind.QUERY); |
| 449 | } else if (typeName === schema.getMutationType()?.name) { |
| 450 | specifiers.push(MapperKind.ROOT_OBJECT, MapperKind.MUTATION); |
| 451 | } else if (typeName === schema.getSubscriptionType()?.name) { |
| 452 | specifiers.push(MapperKind.ROOT_OBJECT, MapperKind.SUBSCRIPTION); |
| 453 | } |
| 454 | } else if (isInputObjectType(type)) { |
| 455 | specifiers.push(MapperKind.INPUT_OBJECT_TYPE); |
| 456 | } else if (isInterfaceType(type)) { |
| 457 | specifiers.push(MapperKind.COMPOSITE_TYPE, MapperKind.ABSTRACT_TYPE, MapperKind.INTERFACE_TYPE); |
| 458 | } else if (isUnionType(type)) { |
| 459 | specifiers.push(MapperKind.COMPOSITE_TYPE, MapperKind.ABSTRACT_TYPE, MapperKind.UNION_TYPE); |
| 460 | } else if (isEnumType(type)) { |
| 461 | specifiers.push(MapperKind.ENUM_TYPE); |
| 462 | } else if (isScalarType(type)) { |
| 463 | specifiers.push(MapperKind.SCALAR_TYPE); |
| 464 | } |
| 465 | |
| 466 | return specifiers; |
| 467 | } |
| 468 | |
| 469 | function getTypeMapper( |
| 470 | schema: GraphQLSchema, |
no test coverage detected
searching dependent graphs…