(schema: GraphQLSchema, typeName: string)
| 484 | } |
| 485 | |
| 486 | function getFieldSpecifiers(schema: GraphQLSchema, typeName: string): SchemaFieldMapperTypes { |
| 487 | const type = schema.getType(typeName); |
| 488 | const specifiers: SchemaFieldMapperTypes = [MapperKind.FIELD]; |
| 489 | |
| 490 | if (isObjectType(type)) { |
| 491 | specifiers.push(MapperKind.COMPOSITE_FIELD, MapperKind.OBJECT_FIELD); |
| 492 | if (typeName === schema.getQueryType()?.name) { |
| 493 | specifiers.push(MapperKind.ROOT_FIELD, MapperKind.QUERY_ROOT_FIELD); |
| 494 | } else if (typeName === schema.getMutationType()?.name) { |
| 495 | specifiers.push(MapperKind.ROOT_FIELD, MapperKind.MUTATION_ROOT_FIELD); |
| 496 | } else if (typeName === schema.getSubscriptionType()?.name) { |
| 497 | specifiers.push(MapperKind.ROOT_FIELD, MapperKind.SUBSCRIPTION_ROOT_FIELD); |
| 498 | } |
| 499 | } else if (isInterfaceType(type)) { |
| 500 | specifiers.push(MapperKind.COMPOSITE_FIELD, MapperKind.INTERFACE_FIELD); |
| 501 | } else if (isInputObjectType(type)) { |
| 502 | specifiers.push(MapperKind.INPUT_OBJECT_FIELD); |
| 503 | } |
| 504 | |
| 505 | return specifiers; |
| 506 | } |
| 507 | |
| 508 | function getFieldMapper<F extends GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig>( |
| 509 | schema: GraphQLSchema, |
no test coverage detected
searching dependent graphs…