MCPcopy Create free account
hub / github.com/subquery/subql / packEntityField

Function packEntityField

packages/utils/src/graphql/entities.ts:357–370  ·  view source on GitHub ↗
(
  typeString: FieldScalar | string,
  field: GraphQLField<unknown, unknown>,
  isForeignKey: boolean
)

Source from the content-addressed store, hash-verified

355}
356
357function packEntityField(
358 typeString: FieldScalar | string,
359 field: GraphQLField<unknown, unknown>,
360 isForeignKey: boolean
361): GraphQLEntityField {
362 return {
363 name: isForeignKey ? `${field.name}Id` : field.name,
364 type: typeString,
365 description: field.description ?? undefined,
366 isArray: isListType(isNonNullType(field.type) ? getNullableType(field.type) : field.type),
367 nullable: !isNonNullType(field.type),
368 isEnum: false,
369 };
370}
371
372function packJSONField(
373 typeString: string,

Callers 1

getAllEntitiesRelationsFunction · 0.85

Calls 1

isListTypeFunction · 0.85

Tested by

no test coverage detected