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[]>>

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

Defined in​

packages/graphql/src/relation.ts:165


getRelationOfImplementation()​

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

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

Defined in​

packages/graphql/src/relation.ts:351


getRelationOfInterface()​

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

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

Defined in​

packages/graphql/src/relation.ts:294


getRelationOfReturn()​

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

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

Defined in​

packages/graphql/src/relation.ts:104


getRelationOfUnion()​

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

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

Defined in​

packages/graphql/src/relation.ts:238