Repository Analysis

apollographql/apollo-client

The industry-leading GraphQL client for TypeScript, JavaScript, React, Vue, Angular, and more. Apollo Client delivers powerful caching, intuitive APIs, and comprehensive developer tools to accelerate your app development.

0.5 Likely human-written View on GitHub
0.5
Adjusted Score
0.5
Raw Score
100%
Time Factor
2026-05-30
Last Push
19,718
Stars
TypeScript
Language
385,435
Lines of Code
873
Files
172
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 8MEDIUM 1LOW 163

Pattern Findings

172 matches across 5 categories. Click a row to expand file-level details.

Over-Commented Block69 hits · 69 pts
SeverityFileLineSnippet
LOW.api-reports/api-report-react_compiled.api.md341// Warning: (ae-forgotten-export) The symbol "InternalRefetchQueriesResult" needs to be exported by the entry point inde
LOW.api-reports/api-report-react_compiled.api.md641 }
LOW.api-reports/api-report-react_compiled.api.md721 // (undocumented)
LOW.api-reports/api-report-react_compiled.api.md2081 client: ApolloClient;
LOW.api-reports/api-report-react_compiled.api.md2361// src/core/types.ts:371:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry p
LOW.api-reports/api-report-core.api.md941
LOW.api-reports/api-report-utilities.api.md61// Warning: (ae-forgotten-export) The symbol "DeepPartialPrimitive" needs to be exported by the entry point index.d.ts
LOW.api-reports/api-report-cache.api.md361 // Warning: (ae-forgotten-export) The symbol "Layer" needs to be exported by the entry point index.d.ts
LOW.api-reports/api-report-cache.api.md381 // (undocumented)
LOW.api-reports/api-report-cache.api.md421 retain(rootId: string): number;
LOW.api-reports/api-report-cache.api.md441 cache: InMemoryCache;
LOW.api-reports/api-report-cache.api.md761 // (undocumented)
LOW.api-reports/api-report-cache.api.md821 // (undocumented)
LOW.api-reports/api-report.api.md781 args?: Record<string, any>;
LOW.api-reports/api-report.api.md1161 // (undocumented)
LOW.api-reports/api-report.api.md1181 // Warning: (ae-forgotten-export) The symbol "CacheGroup" needs to be exported by the entry point index.d.ts
LOW.api-reports/api-report.api.md1201 readonly policies: Policies;
LOW.api-reports/api-report.api.md1281 // (undocumented)
LOW.api-reports/api-report.api.md2261 // (undocumented)
LOW.api-reports/api-report.api.md2321 //
LOW.api-reports/api-report.api.md3061 [dataId: string]: SelectionSetNode[];
LOWconfig/prepareDist.ts1// The Apollo Client source that is published to npm is located in the
LOWintegration-tests/next/next-env.d.ts1/// <reference types="next" />
LOWscripts/codemods/ac3-to-ac4/src/renames.ts1import type { namedTypes } from "ast-types";
LOWscripts/codemods/ac3-to-ac4/src/renames.ts21// },
LOWscripts/codemods/ac3-to-ac4/src/renames.ts721 },
LOWscripts/codemods/ac3-to-ac4/src/renames.ts741 // module: "@apollo/client/react/ssr",
LOW.github/workflows/close-stale-issues.yml61 # # The label to apply when an issue is closed.
LOW.github/workflows/close-stale-issues.yml81
LOW.github/workflows/close-stale-issues.yml141
LOWsrc/core/QueryManager.ts1361 const results: InternalRefetchQueriesMap<TResult> = new Map();
LOWsrc/core/QueryManager.ts1381 // running the updateCache function, triggering only one broadcast.
LOWsrc/core/types.ts241 | RefetchQueriesIncludeShorthand;
LOWsrc/core/ObservableQuery.ts1021 });
LOWsrc/core/ObservableQuery.ts1261 // It's possible to use this method to apply options.nextFetchPolicy to
LOWsrc/core/ObservableQuery.ts1781 dirty &&
LOWsrc/core/index.ts161 isReference,
LOWsrc/core/QueryInfo.ts281 // the network (and the variables match too), avoid writing
LOWsrc/core/QueryInfo.ts301 // contain this data. If some other query has clobbered that
LOW…_tests__/client.watchQuery/streamDefer20220824.test.ts601// non-null, but also emits the friend at index 2 to add to the array. This
LOWsrc/cache/core/cache.ts221 // Optimistic API
LOWsrc/cache/inmemory/policies.ts81 storeObject: StoreObject;
LOWsrc/cache/inmemory/policies.ts221 // Helper function for reading other fields within the current object.
LOWsrc/cache/inmemory/policies.ts481 public addTypePolicies(typePolicies: TypePolicies) {
LOWsrc/cache/inmemory/policies.ts641
LOWsrc/cache/inmemory/policies.ts661 // Field policy inheritance is atomic/shallow: you can't inherit a
LOWsrc/cache/inmemory/inMemoryCache.ts321 // Call this method to undo the effect of the retain method, above. Once the
LOWsrc/cache/inmemory/inMemoryCache.ts561 // This method is wrapped by maybeBroadcastWatch, which is called by
LOWsrc/cache/inmemory/key-extractor.ts121 // For directives without arguments (d defined, but directiveArgs ===
LOWsrc/cache/inmemory/writeToStore.ts681 // Items in the same position in different arrays are not
LOWsrc/cache/inmemory/entityStore.ts501 const workSet = new Set<Record<string | number, any>>([root]);
LOWsrc/cache/inmemory/entityStore.ts601 };
LOWsrc/cache/inmemory/entityStore.ts761 // easy access to higher layers here, and we're about to recreate those
LOWsrc/utilities/internal/mergeDeep.ts1import { mergeDeepArray } from "./mergeDeepArray.js";
LOWsrc/utilities/internal/removeDirectivesFromDocument.ts301 getInUseByOperationName(node.name && node.name.value)
LOWsrc/utilities/internal/types/DeepOmit.ts1import type { Primitive } from "./Primitive.js";
LOWsrc/__tests__/optimistic.ts2121 // optimistic transactions would trigger additional
LOWsrc/link/subscriptions/index.ts1// This file is adapted from the graphql-ws npm package:
LOWsrc/link/http/selectHttpOptionsAndBody.ts21 accept: "application/graphql-response+json,application/json;q=0.9",
LOWsrc/react/index.react-server.ts41// prettier-ignore
9 more matches not shown…
Hyper-Verbose Identifiers67 hits · 68 pts
SeverityFileLineSnippet
LOW.api-reports/api-report-utilities_internal.api.md303export function getGraphQLErrorsFromResult(result: {
LOW.api-reports/api-report-utilities_internal.api.md471export function removeDirectivesFromDocument(directives: RemoveDirectiveConfig[], doc: DocumentNode): DocumentNode | nul
LOW.api-reports/api-report-utilities_internal.api.md479export function removeMaskedFragmentSpreads(document: DocumentNode): DocumentNode;
LOW.api-reports/api-report-testing_internal.api.md65export function createOperationWithDefaultContext(context: any, operation: GraphQLRequest, executeContext?: ExecuteConte
LOW.api-reports/api-report-testing_internal.api.md71export function executeWithDefaultContext(link: ApolloLink_2, operation: GraphQLRequest, context?: ExecuteContext): Obse
LOW.api-reports/api-report-link_http.api.md122export function parseAndCheckHttpResponse(operations: ApolloLink.Operation | ApolloLink.Operation[]): (response: Respons
LOW.api-reports/api-report-link_http.api.md142export function selectHttpOptionsAndBodyInternal(operation: ApolloLink.Operation, printer: BaseHttpLink.Printer, ...conf
LOW.api-reports/api-report-utilities.api.md136export function isFormattedExecutionResult(result?: object): result is FormattedExecutionResult;
LOW…eports/api-report-utilities_subscriptions_relay.api.md15export function createFetchMultipartSubscription(uri: string, { fetch: preferredFetch, headers }?: CreateMultipartSubscr
LOW.api-reports/api-report-link_remove-typename.api.md13export function removeTypenameFromVariables(options?: RemoveTypenameFromVariablesLink.Options): RemoveTypenameFromVariab
LOW.api-reports/api-report.api.md2298export function parseAndCheckHttpResponse(operations: ApolloLink.Operation | ApolloLink.Operation[]): (response: Respons
LOW.api-reports/api-report.api.md2761export function selectHttpOptionsAndBodyInternal(operation: ApolloLink.Operation, printer: BaseHttpLink.Printer, ...conf
LOWconfig/helpers.ts183export function patchApiExtractorInternals() {
LOWconfig/prettier/format-mdx3.js44function handleCodeBlockWithSpecialComments(node, path, options) {
LOWeslint-local-rules/import-from-export.ts33function findNearestEntryPointFolder(filename: string) {
LOW…pts/codemods/ac3-to-ac4/src/util/handleModuleRename.ts19 function renameNamespaceOrSideEffectImports() {
LOW…pts/codemods/ac3-to-ac4/src/util/handleModuleRename.ts39 function mergeIntoExistingOrRenameImport() {
LOW…-ac4/src/util/moveGlobalIdentifierToNamespaceAccess.ts8export function moveGlobalIdentifierToNamespaceAccess({
LOW…s/ac3-to-ac4/src/util/callExpressionToNewExpression.ts9export function callExpressionToNewExpression(): (args: {
LOWscripts/codemods/data-masking/unmask.ts49 function addUnmaskToTaggedTemplate(name: string) {
LOWscripts/codemods/data-masking/unmask.ts59 function addUnmaskToTemplateLiteral(template: Collection<TemplateLiteral>) {
LOWscripts/codemods/data-masking/unmask.ts100function applyIndentationFromOriginalQuery(
LOWscripts/codemods/ac2-to-ac3/imports.js53 function renameOrCreateApolloClientImport() {
LOWscripts/codemods/ac2-to-ac3/imports.js73 function removeApolloClientImportIfEmpty() {
LOWscripts/codemods/ac2-to-ac3/imports.js80 function moveSpecifiersToApolloClient(moduleName) {
LOWsrc/core/QueryManager.ts1809function addNonReactiveToNamedFragments(document: DocumentNode) {
LOWsrc/core/QueryManager.ts1834function removeStreamDetailsFromExtensions(
LOWsrc/core/QueryInfo.ts67function wrapDestructiveCacheMethod(
LOWsrc/cache/inmemory/helpers.ts71export function getTypenameFromStoreObject(
LOWsrc/cache/inmemory/helpers.ts87export function selectionSetMatchesResult(
LOWsrc/cache/inmemory/helpers.ts127export function makeProcessedFieldsMerger() {
LOWsrc/cache/inmemory/readFromStore.ts490function assertSelectionSetForIdValue(
LOWsrc/cache/inmemory/policies.ts1089function makeMergeFieldFunctionOptions(
LOWsrc/cache/inmemory/policies.ts1128export function normalizeReadFieldOptions(
LOWsrc/cache/inmemory/writeToStore.ts832function maybeRecycleChildMergeTree({ map }: MergeTree, name: string | number) {
LOWsrc/cache/inmemory/entityStore.ts684export function maybeDependOnExistenceOfEntity(
LOWsrc/cache/inmemory/__tests__/helpers.ts12export function defaultNormalizedCacheFactory(
LOWsrc/utilities/invariant/__tests__/invariant.test.ts35function disableErrorMessageHandler() {
LOWsrc/utilities/internal/valueToObjectRepresentation.ts7export function valueToObjectRepresentation(
LOWsrc/utilities/internal/removeFragmentSpreads.ts4export function removeMaskedFragmentSpreads(document: DocumentNode) {
LOWsrc/utilities/internal/getGraphQLErrorsFromResult.ts4export function getGraphQLErrorsFromResult(result: {
LOWsrc/utilities/internal/equalByQuery.ts140function selectionHasNonreactiveDirective(
LOWsrc/utilities/internal/removeDirectivesFromDocument.ts38export function removeDirectivesFromDocument(
LOWsrc/utilities/subscriptions/relay/index.ts20export function createFetchMultipartSubscription(
LOWsrc/utilities/subscriptions/relay/index.ts24 return function fetchMultipartSubscription(
LOWsrc/utilities/subscriptions/relay/index.ts73function generateOptionsForMultipartSubscription(
LOWsrc/utilities/graphql/isFormattedExecutionResult.ts30export function isFormattedExecutionResult(
LOWsrc/utilities/graphql/__tests__/DocumentTransform.ts33function addClientDirectiveToField(fieldName: string) {
LOWsrc/testing/internal/link.ts5function createDefaultExecuteContext() {
LOWsrc/testing/internal/link.ts14export function executeWithDefaultContext(
LOWsrc/testing/internal/link.ts22export function createOperationWithDefaultContext(
LOWsrc/testing/matchers/toRerenderWithSimilarSnapshot.ts90> = async function toRerenderWithSimilarSnapshot(
LOWsrc/testing/matchers/utils/getSerializableProperties.ts8export function getSerializableProperties(
LOWsrc/__tests__/optimistic.ts325 function checkBothMutationsAreApplied(
LOWsrc/__tests__/optimistic.ts548 function checkBothMutationsAreApplied(
LOWsrc/link/remove-typename/removeTypenameFromVariables.ts126export function removeTypenameFromVariables(
LOWsrc/link/http/selectHttpOptionsAndBody.ts63export function selectHttpOptionsAndBodyInternal(
LOWsrc/link/http/parseAndCheckHttpResponse.ts165function parseGraphQLResponseJsonEncoding(
LOWsrc/link/http/parseAndCheckHttpResponse.ts186export function parseAndCheckHttpResponse(
LOWsrc/link/http/__tests__/HttpLink.ts1137 function trackGlobalAbortControllers() {
7 more matches not shown…
Cross-Language Confusion (JS/TS)8 hits · 40 pts
SeverityFileLineSnippet
HIGHconfig/prettier/format-jsdoc.js28 print(path, options, print, args) {
HIGHscripts/codemods/data-masking/unmask.ts113 print(document)
HIGHsrc/core/__tests__/ApolloClient/general.test.ts7701 print(addTypenameToDocument(query)),
HIGHsrc/core/__tests__/ApolloClient/general.test.ts7740 print(addTypenameToDocument(query)),
HIGHsrc/utilities/graphql/__tests__/transform.ts164 print(gql`
HIGHsrc/utilities/graphql/__tests__/transform.ts206 print(gql`
HIGHsrc/utilities/graphql/__tests__/transform.ts231 print(wholeQueryFromJustTheFragment)
HIGHsrc/utilities/graphql/__tests__/transform.ts235 print(gql`
Fake / Example Data27 hits · 28 pts
SeverityFileLineSnippet
LOWintegration-tests/vite/src/enhanceMaskingTypes.ts31 name: "John Doe",
LOWsrc/cache/inmemory/__tests__/policies.ts718 name: "John Doe",
LOWsrc/utilities/common/stripTypename.ts15 * profile: { __typename: "Profile", name: "John Doe" },
LOWsrc/utilities/common/stripTypename.ts17 * // => { id: 1, profile: { name: "John Doe"}}
LOWsrc/__tests__/client.ts5219 data: { currentUser: { __typename: "User", id: 1, name: "John Doe" } },
LOWsrc/__tests__/client.ts5245 currentUser: { __typename: "User", id: 1, name: "John Doe" },
LOWsrc/react/hooks/internal/__tests__/useDeepMemo.test.ts25 user: { name: "John Doe" },
LOWsrc/react/hooks/internal/__tests__/useDeepMemo.test.ts32 rerender({ active: true, items: [1, 2], user: { name: "John Doe" } });
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2357 result: { data: { user: { id: "1", name: "John Doe" } } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2362 result: { data: { user: { id: "2", name: "Jane Doe" } } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2444 result: { data: { user: { id: "1", name: "John Doe" } } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2449 result: { data: { user: { id: "2", name: "Jane Doe" } } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2627 data: { user: { id: operation.variables.id, name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2688 { id, name: "John Doe" }
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2717 data: { user: { id: "2", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2738 previousData: { user: { id: "2", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2768 result: { data: { user: { id: "1", name: "John Doe" } } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2871 data: { user: { id: "1", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2893 data: { user: { id: "1", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2919 previousData: { user: { id: "1", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2934 previousData: { user: { id: "1", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2961 previousData: { user: { id: "1", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2977 previousData: { user: { id: "1", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx2991 previousData: { user: { id: "1", name: "John Doe" } },
LOWsrc/react/hooks/__tests__/useLazyQuery.test.tsx3032 data: { user: { id: operation.variables.id, name: "John Doe" } },
LOWsrc/masking/__tests__/maskOperation.test.ts1571 { __typename: "User", id: 1, name: "John Doe", age: 30 },
LOWsrc/masking/__tests__/maskOperation.test.ts1572 { __typename: "User", id: 2, name: "Jane Doe", age: 30 },
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippet
MEDIUM…_tests__/client.watchQuery/streamDefer20220824.test.ts607// This can be addressed in a more robust way in the the future once Apollo