Skip to main content

relation

Library supporting relatedTypeSection for displaying relations between GraphQL schema entities.

See

Option `relatedTypeSection`

getRelationOfField()

function getRelationOfField(type, schemaMap): Partial<Record<SchemaEntity, RelationOfField[]>>

Defined in: packages/graphql/src/relation.ts:167

Returns a map of fields and arguments where the GraphQL schema type matches the type.

Parameters

type

unknown

the GraphQL schema type being processed.

schemaMap

Maybe<SchemaMap>

a GraphQL schema map (see introspection!getSchemaMap).

Returns

Partial<Record<SchemaEntity, RelationOfField[]>>

a record map of fields and arguments relations.

See

mapRelationOf


getRelationOfImplementation()

function getRelationOfImplementation(type, schemaMap): Partial<Record<SchemaEntity, RelationOfImplementation[]>>

Defined in: packages/graphql/src/relation.ts:353

Returns a map of types (unions or interfaces) where the GraphQL schema type is implemented.

Parameters

type

unknown

the GraphQL schema type being processed.

schemaMap

Maybe<SchemaMap>

a GraphQL schema map (see introspection!getSchemaMap).

Returns

Partial<Record<SchemaEntity, RelationOfImplementation[]>>

a record map of unions or interfaces relations.

See

mapRelationOf


getRelationOfInterface()

function getRelationOfInterface(type, schemaMap): Partial<Record<SchemaEntity, RelationOfInterface[]>>

Defined in: packages/graphql/src/relation.ts:296

Returns a map of interfaces where the GraphQL schema type is extended.

Parameters

type

unknown

the GraphQL schema type being processed.

schemaMap

Maybe<SchemaMap>

a GraphQL schema map (see introspection!getSchemaMap).

Returns

Partial<Record<SchemaEntity, RelationOfInterface[]>>

a record map of interfaces relations.

See

mapRelationOf


getRelationOfReturn()

function getRelationOfReturn(type, schemaMap): Partial<Record<SchemaEntity, GraphQLOperationType[]>>

Defined in: packages/graphql/src/relation.ts:106

Returns a map of operations (queries, mutations, subscriptions) where the GraphQL schema type is the return type.

Parameters

type

unknown

the GraphQL schema type being processed.

schemaMap

Maybe<SchemaMap>

a GraphQL schema map (see introspection!getSchemaMap).

Returns

Partial<Record<SchemaEntity, GraphQLOperationType[]>>

a record map of operations relations.

See

mapRelationOf


getRelationOfUnion()

function getRelationOfUnion(type, schemaMap): Partial<Record<SchemaEntity, GraphQLUnionType[]>>

Defined in: packages/graphql/src/relation.ts:240

Returns a map of unions where the GraphQL schema type is part of it.

Parameters

type

unknown

the GraphQL schema type being processed.

schemaMap

Maybe<SchemaMap>

a GraphQL schema map (see introspection!getSchemaMap).

Returns

Partial<Record<SchemaEntity, GraphQLUnionType[]>>

a record map of unions relations.

See

mapRelationOf