Skip to content
Open
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
6 changes: 0 additions & 6 deletions src/api/articleApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export const fetchTransformedContent = async (
if (params.contextId && !subjectId) {
const contextNode = await context.loaders.nodesLoader.load({
contextId: params.contextId,
includeContexts: true,
filterProgrammes: true,
});
const contextRootId = contextNode[0]?.context?.rootId;
if (contextRootId) {
Expand Down Expand Up @@ -68,8 +66,6 @@ export const fetchTransformedDisclaimer = async (
if (params.contextId && !subjectId) {
const contextNode = await context.loaders.nodesLoader.load({
contextId: params.contextId,
includeContexts: true,
filterProgrammes: true,
});
const contextRootId = contextNode[0]?.context?.rootId;
if (contextRootId) {
Expand Down Expand Up @@ -114,8 +110,6 @@ export async function fetchRelatedContent(
const nodes = await context.loaders.nodesLoader.load({
contentURI: `urn:article:${related.id}`,
language: context.language,
includeContexts: true,
filterProgrammes: true,
});
const node = nodes?.[0];
if (node) {
Expand Down
4 changes: 0 additions & 4 deletions src/api/embedsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ const contentLinkMeta: Fetch<ContentLinkMetaData> = async ({ embedData, context,
const nodes = await context.loaders.nodesLoader.load({
contentURI,
language: context.language,
includeContexts: true,
filterProgrammes: true,
isVisible: true,
});

Expand Down Expand Up @@ -239,8 +237,6 @@ const relatedContentMeta: Fetch<RelatedContentMetaData> = async ({ embedData, co
context.loaders.nodesLoader.load({
contentURI: `urn:article:${articleId}`,
language: context.language,
filterProgrammes: true,
includeContexts: true,
isVisible: true,
rootId: opts.subject,
}),
Expand Down
10 changes: 0 additions & 10 deletions src/api/taxonomyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export async function fetchSubjectTopics(subjectId: string, context: Context): P
recursive: true,
nodeType: ["TOPIC"],
language: context.language,
includeContexts: true,
filterProgrammes: true,
},
},
})
Expand All @@ -56,8 +54,6 @@ export async function fetchNode(
query: {
language: context.language,
isVisible: true,
includeContexts: true,
filterProgrammes: true,
rootId,
parentId,
},
Expand All @@ -74,8 +70,6 @@ export async function searchNodes(params: { contentUris: string[] }, context: Co
contentUris: params.contentUris,
// TODO: This doesn't exist?
// isVisible: true,
includeContexts: true,
filterProgrammes: true,
page: 1,
pageSize: 100,
},
Expand All @@ -101,8 +95,6 @@ export async function fetchChildren(
recursive: params.recursive,
connectionTypes: params.connectionTypes ? [params.connectionTypes as NodeConnectionType] : undefined,
isVisible: true,
includeContexts: true,
filterProgrammes: true,
language: context.language,
},
},
Expand All @@ -123,8 +115,6 @@ export async function fetchNodeResources(params: FetchNodeResourcesParams, conte
language: context.language,
relevance: params.relevance,
isVisible: true,
includeContexts: true,
filterProgrammes: true,
},
},
})
Expand Down
9 changes: 1 addition & 8 deletions src/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,7 @@ export function nodesLoader(context: Context): DataLoader<NodeQueryParams, Node[
if (!input) {
throw Error("Tried to get node with no params");
}
return queryNodes(
{
includeContexts: true,
filterProgrammes: true,
...input,
},
context,
);
return queryNodes(input, context);
}),
);
},
Expand Down
1 change: 0 additions & 1 deletion src/resolvers/programmeResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const Query = {
contextId: id,
language: context.language,
filterProgrammes: false,
includeContexts: true,
});
if (!node[0]) {
throw new GraphQLError(`No programme found with contextId: ${contextId}`, {
Expand Down
2 changes: 0 additions & 2 deletions src/resolvers/resourceResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export const Query = {
.load({
contentURI: `urn:article:${articleId}`,
language: context.language,
includeContexts: true,
filterProgrammes: true,
isVisible: true,
})
.then((nodes) => nodes[0])
Expand Down
4 changes: 0 additions & 4 deletions src/resolvers/subjectResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export const Query = {
return context.loaders.nodesLoader.load({
language: context.language,
nodeType: "SUBJECT",
includeContexts: true,
filterProgrammes: true,
key: input?.metadataFilterKey,
value: input?.metadataFilterValue,
isVisible: input?.filterVisible,
Expand All @@ -58,8 +56,6 @@ export const Query = {
key: "language",
value: language,
nodeType: "SUBJECT",
includeContexts: true,
filterProgrammes: true,
})
.then((s) => s.sort((a, b) => (a.name < b.name ? -1 : 1)));
},
Expand Down
8 changes: 0 additions & 8 deletions src/resolvers/taxonomyResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export const Query = {
if (contextId) {
const nodes = await context.loaders.nodesLoader.load({
contextId,
includeContexts: true,
filterProgrammes: true,
});
if (nodes.length === 0) {
throw new GraphQLError(`No node found with contextId: ${contextId}`, {
Expand All @@ -66,8 +64,6 @@ export const Query = {
key: metadataFilterKey,
value: metadataFilterValue,
isVisible: filterVisible,
includeContexts: true,
filterProgrammes: true,
language: context.language,
};
let nodes: Node[] = [];
Expand All @@ -94,8 +90,6 @@ export const Query = {
const res = await context.loaders.nodesLoader.load({
contentURI: `urn:article:${articleId}`,
language: context.language,
includeContexts: true,
filterProgrammes: true,
isVisible: true,
});
node = res[0];
Expand Down Expand Up @@ -173,8 +167,6 @@ export const resolvers = {
if (!url && contentUri) {
const nodes = await context.loaders.nodesLoader.load({
contentURI: contentUri,
includeContexts: true,
filterProgrammes: true,
isVisible: true,
language: context.language,
});
Expand Down
4 changes: 0 additions & 4 deletions src/resolvers/topicResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export const Query = {
const nodes = await context.loaders.nodesLoader.load({
contentURI: contentUri,
isVisible: filterVisible,
includeContexts: true,
filterProgrammes: true,
language: context.language,
});
return nodes.map((node) => {
Expand Down Expand Up @@ -64,8 +62,6 @@ export const resolvers = {
if (!path && contentUri) {
const nodes = await context.loaders.nodesLoader.load({
contentURI: contentUri,
includeContexts: true,
filterProgrammes: true,
isVisible: true,
language: context.language,
});
Expand Down
Loading