Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/lib/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
branches: 90,
functions: 95,
lines: 95,
statements: -4,
statements: -5,
},
},
moduleNameMapper: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class CrdGatewayKcpPatchResolver {
entityId?: string,
kind?: string,
) {
if (nextNode.context.kcpPath) {
if (nextNode.context?.kcpPath) {
this.gatewayService.updateCrdGatewayUrlWithEntityPath(
nextNode.context.kcpPath,
);
Expand Down
10 changes: 7 additions & 3 deletions projects/lib/services/resource/apollo-factory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GatewayService } from './gateway.service';
import { ResourceNodeContext } from './resource-node-context';
import { Injectable, NgZone, inject } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import {
type ApolloClientOptions,
ApolloLink,
Expand Down Expand Up @@ -39,20 +39,24 @@ class SSELink extends ApolloLink {
}
}

const noopZone = {
run: (fn: any) => fn(),
runOutsideAngular: (fn: any) => fn(),
} as any;

@Injectable({
providedIn: 'root',
})
export class ApolloFactory {
private httpLink = inject(HttpLink);
private ngZone = inject(NgZone);
private gatewayService = inject(GatewayService);

public readonly apollo = (
nodeContext: ResourceNodeContext,
readFromParentKcpPath = false,
): Apollo =>
new Apollo(
this.ngZone,
noopZone,
this.createApolloOptions(nodeContext, readFromParentKcpPath),
);

Expand Down
Loading