Skip to content

Commit

Permalink
Handle unknown destinations
Browse files Browse the repository at this point in the history
  • Loading branch information
joonashak committed Oct 19, 2024
1 parent 780deb3 commit 9735385
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/src/entities/connection/connection.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class Connection {
@Field()
id: string;

@Field()
@Field({ nullable: true })
@Prop({ index: true })
from: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ const findChildren = (
);

const directChildren = connectionsWithoutReverse.filter(
//FIXME: This will probably break for unknown destinations.
(conn) => conn.from === start.to,
(conn) => start.to && conn.from === start.to,
);

if (directChildren.length === 0) {
Expand Down
8 changes: 4 additions & 4 deletions web/src/generated/graphqlOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type ChainRoot = {
children: Array<GraphConnection>;
eol: Scalars['Boolean']['output'];
eolAt?: Maybe<Scalars['DateTime']['output']>;
from: Scalars['String']['output'];
from?: Maybe<Scalars['String']['output']>;
id: Scalars['String']['output'];
k162: Scalars['Boolean']['output'];
massStatus: MassStatus;
Expand All @@ -83,7 +83,7 @@ export type Connection = {
__typename?: 'Connection';
eol: Scalars['Boolean']['output'];
eolAt?: Maybe<Scalars['DateTime']['output']>;
from: Scalars['String']['output'];
from?: Maybe<Scalars['String']['output']>;
id: Scalars['String']['output'];
k162: Scalars['Boolean']['output'];
massStatus: MassStatus;
Expand Down Expand Up @@ -210,7 +210,7 @@ export type GraphConnection = {
depth: Scalars['Float']['output'];
eol: Scalars['Boolean']['output'];
eolAt?: Maybe<Scalars['DateTime']['output']>;
from: Scalars['String']['output'];
from?: Maybe<Scalars['String']['output']>;
id: Scalars['String']['output'];
k162: Scalars['Boolean']['output'];
massStatus: MassStatus;
Expand Down Expand Up @@ -589,7 +589,7 @@ export type FindConnectionGraphQueryVariables = Exact<{
}>;


export type FindConnectionGraphQuery = { __typename?: 'Query', findConnectionGraph: { __typename?: 'FindConnectionGraph', root: string, chains: Array<{ __typename?: 'ChainRoot', id: string, from: string, to?: string | null, type?: string | null, k162: boolean, eol: boolean, eolAt?: any | null, massStatus: MassStatus, reverse: string, children: Array<{ __typename?: 'GraphConnection', id: string, from: string, to?: string | null, type?: string | null, k162: boolean, eol: boolean, eolAt?: any | null, massStatus: MassStatus, reverse: string, depth: number }> }> } };
export type FindConnectionGraphQuery = { __typename?: 'Query', findConnectionGraph: { __typename?: 'FindConnectionGraph', root: string, chains: Array<{ __typename?: 'ChainRoot', id: string, from?: string | null, to?: string | null, type?: string | null, k162: boolean, eol: boolean, eolAt?: any | null, massStatus: MassStatus, reverse: string, children: Array<{ __typename?: 'GraphConnection', id: string, from?: string | null, to?: string | null, type?: string | null, k162: boolean, eol: boolean, eolAt?: any | null, massStatus: MassStatus, reverse: string, depth: number }> }> } };

export type UserFieldsForManagerFragment = { __typename?: 'SanitizedUserForManager', id: string, systemRole: SystemRoles, main: { __typename?: 'HolenavCharacter', esiId: string, name: string, portraitUrl: string, isMain: boolean, corporation: { __typename?: 'HolenavCorporation', esiId: string, name: string, ticker: string }, alliance?: { __typename?: 'HolenavAlliance', esiId: string, name: string, ticker: string } | null } };

Expand Down

0 comments on commit 9735385

Please sign in to comment.