How to use the nullableTypeAnnotation function from babel-types

Find comprehensive JavaScript babel-types.nullableTypeAnnotation code examples handpicked from public code repositorys.

34
35
36
37
38
39
40
41
42
43
  objectProps?: mixed,
) {
  if (type instanceof GraphQLNonNull) {
    return transformNonNullableScalarType(type.ofType, state, objectProps);
  } else {
    return t.nullableTypeAnnotation(
      transformNonNullableScalarType(type, state, objectProps),
    );
  }
}
fork icon0
star icon10
watch icon3

+ 11 other calls in file

160
161
162
163
164
165
166
167
168
169
  body = wrapNullOrArray(
    node.type,
    transformScalarField(getRawType(node.type)),
  );
  if (body.type !== 'NullableTypeAnnotation' && forceNull) {
    body = t.nullableTypeAnnotation(body);
  }
  annotation = t.objectTypeProperty(t.identifier(name), body);
  break;
case 'LinkedField':
fork icon0
star icon1
watch icon2

+ 19 other calls in file

Other functions in babel-types

Sorted by popularity

function icon

babel-types.identifier is the most popular function in babel-types (4076 examples)