Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
338 changes: 169 additions & 169 deletions composition-go/index.global.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composition/src/errors/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
SemanticNonNullLevelsIndexOutOfBoundsErrorParams,
SemanticNonNullLevelsNonNullErrorParams,
} from './types';
import { UnresolvableFieldData } from '../resolvability-graph/utils';
import { UnresolvableFieldData } from '../resolvability-graph/utils/utils';
import {
AND_UPPER,
ARGUMENT,
Expand Down
5 changes: 4 additions & 1 deletion composition/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export * from './normalization/normalization';
export * from './normalization/types';
export * from './resolvability-graph/graph';
export * from './resolvability-graph/graph-nodes';
export * from './resolvability-graph/utils';
export * from './resolvability-graph/node-resolution-data/node-resolution-data';
export * from './resolvability-graph/node-resolution-data/types/params';
export * from './resolvability-graph/utils/types/types';
export * from './resolvability-graph/utils/utils';
export * from './router-compatibility-version/router-compatibility-version';
export * from './router-configuration/types';
export * from './router-configuration/utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const MUTATION = 'Mutation';
export const QUERY = 'Query';
export const SUBSCRIPTION = 'Subscription';

export const LITERAL_PERIOD = '.';
export const LITERAL_SPACE = ' ';
export const NOT_APPLICABLE = 'N/A';
export const QUOTATION_JOIN = '", "';

export const ROOT_TYPE_NAMES = new Set<string>([MUTATION, QUERY, SUBSCRIPTION]);
15 changes: 8 additions & 7 deletions composition/src/resolvability-graph/graph-nodes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { add, getEntriesNotInHashSet, getValueOrDefault } from '../utils/utils';
import { GraphFieldData } from '../utils/types';
import { SubgraphName, TypeName } from './types/types';

export class Edge {
edgeName: string;
Expand All @@ -23,10 +24,10 @@ export type GraphNodeOptions = {
};

export class GraphNode {
fieldDataByFieldName = new Map<string, GraphFieldData>();
fieldDataByName = new Map<string, GraphFieldData>();
headToTailEdges = new Map<string, Edge>();
entityEdges: Array<Edge> = [];
nodeName: string;
entityEdges = new Array<Edge>();
nodeName: `${SubgraphName}.${TypeName}`;
hasEntitySiblings = false;
isAbstract: boolean;
isInaccessible = false;
Expand All @@ -48,7 +49,7 @@ export class GraphNode {
if (this.isAbstract) {
return;
}
const inaccessibleFieldNames = getEntriesNotInHashSet(this.headToTailEdges.keys(), this.fieldDataByFieldName);
const inaccessibleFieldNames = getEntriesNotInHashSet(this.headToTailEdges.keys(), this.fieldDataByName);
for (const fieldName of inaccessibleFieldNames) {
const headToTailEdge = this.headToTailEdges.get(fieldName);
if (!headToTailEdge) {
Expand Down Expand Up @@ -76,8 +77,8 @@ export class GraphNode {
}

export class RootNode {
fieldDataByFieldName = new Map<string, GraphFieldData>();
headToShareableTailEdges = new Map<string, Array<Edge>>();
fieldDataByName = new Map<string, GraphFieldData>();
headToSharedTailEdges = new Map<string, Array<Edge>>();
// It is used
isAbstract = false;
isRootNode = true;
Expand All @@ -88,7 +89,7 @@ export class RootNode {
}

removeInaccessibleEdges(fieldDataByFieldName: Map<string, GraphFieldData>) {
for (const [fieldName, edges] of this.headToShareableTailEdges) {
for (const [fieldName, edges] of this.headToSharedTailEdges) {
if (fieldDataByFieldName.has(fieldName)) {
continue;
}
Expand Down
Loading
Loading