mv-tmp-data-graphql-simple
Version:
A GraphQL simple data provider for mv-tmp
19 lines (15 loc) • 388 B
text/typescript
import {
IntrospectionType,
IntrospectionListTypeRef,
IntrospectionTypeRef,
TypeKind,
} from 'graphql';
const isRequired = (
type: IntrospectionType | IntrospectionListTypeRef | IntrospectionTypeRef
) => {
if (type.kind === TypeKind.LIST) {
return isRequired(type.ofType);
}
return type.kind === TypeKind.NON_NULL;
};
export default isRequired;