(type, schema)
| 152 | } |
| 153 | |
| 154 | function getTypeKind(type, schema) { |
| 155 | type = removeMarkers(type) |
| 156 | |
| 157 | const typeFromSchema = schema.getType(type) |
| 158 | |
| 159 | if (isScalarType(typeFromSchema)) { |
| 160 | return 'scalars' |
| 161 | } |
| 162 | if (isObjectType(typeFromSchema)) { |
| 163 | return 'objects' |
| 164 | } |
| 165 | if (isInterfaceType(typeFromSchema)) { |
| 166 | return 'interfaces' |
| 167 | } |
| 168 | if (isUnionType(typeFromSchema)) { |
| 169 | return 'unions' |
| 170 | } |
| 171 | if (isEnumType(typeFromSchema)) { |
| 172 | return 'enums' |
| 173 | } |
| 174 | if (isInputObjectType(typeFromSchema)) { |
| 175 | return 'input-objects' |
| 176 | } |
| 177 | |
| 178 | console.error(`cannot find type kind of ${type}`) |
| 179 | } |
| 180 | |
| 181 | function removeMarkers(str) { |
| 182 | return str.replace('[', '').replace(']', '').replace(/!/g, '') |
no test coverage detected