UNPKG

@graphql-codegen/visitor-plugin-common

Version:
11 lines (10 loc) 410 B
import { isIntrospectionType, isSpecifiedScalarType } from 'graphql'; export const isNativeNamedType = (namedType) => { // "Native" NamedType in this context means the following: // 1. introspection types i.e. with `__` prefixes // 2. base scalars e.g. Boolean, Int, etc. if (isSpecifiedScalarType(namedType) || isIntrospectionType(namedType)) { return true; } return false; };