Skip to content

Commit

Permalink
add links mode to upgraded meta
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired authored and gitKrystan committed Nov 12, 2024
1 parent 68544a2 commit 37ff203
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/graph/src/-private/-edge-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export interface UpgradedMeta {
isCollection: boolean;
isPolymorphic: boolean;
resetOnRemoteUpdate: boolean;
isLinksMode: boolean;

inverseKind: 'implicit' | RelationshipFieldKind;
/**
Expand All @@ -140,6 +141,7 @@ export interface UpgradedMeta {
inverseIsImplicit: boolean;
inverseIsCollection: boolean;
inverseIsPolymorphic: boolean;
inverseIsLinksMode: boolean;
}

export interface EdgeDefinition {
Expand Down Expand Up @@ -215,12 +217,14 @@ function upgradeMeta(meta: RelationshipField): UpgradedMeta {
niceMeta.isImplicit = false;
niceMeta.isCollection = meta.kind === 'hasMany';
niceMeta.isPolymorphic = options && !!options.polymorphic;
niceMeta.isLinksMode = options.linksMode ?? false;

niceMeta.inverseKey = (options && options.inverse) || STR_LATER;
niceMeta.inverseType = STR_LATER;
niceMeta.inverseIsAsync = BOOL_LATER;
niceMeta.inverseIsImplicit = (options && options.inverse === null) || BOOL_LATER;
niceMeta.inverseIsCollection = BOOL_LATER;
niceMeta.inverseIsLinksMode = BOOL_LATER;

niceMeta.resetOnRemoteUpdate = isLegacyField(meta)
? meta.options?.resetOnRemoteUpdate === false
Expand Down

0 comments on commit 37ff203

Please sign in to comment.