export const errorCodes = // This file is used by the error message display website and the
// @apollo/client/includeErrors entry point.
// This file is not meant to be imported manually.
{
  1: {
    file: "@apollo/client/__cjs/utilities/graphql/DocumentTransform.cjs",
    condition: "Array.isArray(cacheKeys)",
    message: "`getCacheKey` must return an array or undefined"
  },

  2: {
    file: "@apollo/client/__cjs/utilities/graphql/directives.cjs",
    condition: "evaledValue !== void 0",
    message: `Invalid variable referenced in @%s directive.`
  },

  3: {
    file: "@apollo/client/__cjs/utilities/graphql/directives.cjs",
    condition: "directiveArguments && directiveArguments.length === 1",
    message: `Incorrect number of arguments for the @%s directive.`
  },

  4: {
    file: "@apollo/client/__cjs/utilities/graphql/directives.cjs",
    condition: "ifArgument.name && ifArgument.name.value === \"if\"",
    message: `Invalid argument for the @%s directive.`
  },

  5: {
    file: "@apollo/client/__cjs/utilities/graphql/directives.cjs",
    condition: "ifValue &&\n    (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
    message: `Argument for the @%s directive must be a variable or a boolean value.`
  },

  9: {
    file: "@apollo/client/__cjs/utilities/graphql/fragments.cjs",

    message: `Found a %s operation%s. ` +
        "No operations are allowed when using a fragment as a query. Only fragments are allowed."
  },

  10: {
    file: "@apollo/client/__cjs/utilities/graphql/fragments.cjs",
    condition: "fragments.length === 1",
    message: `Found %s fragments. \`fragmentName\` must be provided when there is not exactly 1 fragment.`
  },

  11: {
    file: "@apollo/client/__cjs/utilities/graphql/fragments.cjs",
    condition: "fragment",
    message: `No fragment named %s`
  },

  12: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    condition: "doc && doc.kind === \"Document\"",

    message: `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \
string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
  },

  13: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    message: `Schema type definitions not allowed in queries. Found: "%s"`
  },

  14: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    condition: "operations.length <= 1",
    message: `Ambiguous GraphQL document: contains %s operations`
  },

  15: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    condition: "operations.length == 1 && operations[0].operation === expectedType",
    message: `Running a %s requires a graphql ` + `%s, but a %s was used instead.`
  },

  16: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    condition: "queryDef && queryDef.operation === \"query\"",
    message: "Must contain a query definition."
  },

  17: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    condition: "doc.kind === \"Document\"",

    message: `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \
string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
  },

  18: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    condition: "doc.definitions.length <= 1",
    message: "Fragment must have exactly one definition."
  },

  19: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    condition: "fragmentDef.kind === \"FragmentDefinition\"",
    message: "Must be a fragment definition."
  },

  20: {
    file: "@apollo/client/__cjs/utilities/graphql/getFromAST.cjs",
    message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
  },

  21: {
    file: "@apollo/client/__cjs/utilities/graphql/storeUtils.cjs",

    message: `The inline argument "%s" of kind "%s"` +
        "is not supported. Use variables instead of inline arguments to " +
        "overcome this limitation."
  },

  24: {
    file: "@apollo/client/__cjs/testing/core/mocking/mockLink.cjs",
    condition: "max > min",
    message: "realisticDelay: `min` must be less than `max`"
  },

  25: {
    file: "@apollo/client/__cjs/testing/core/mocking/mockLink.cjs",
    condition: "queryWithoutClientOnlyDirectives",
    message: "query is required"
  },

  26: {
    file: "@apollo/client/__cjs/testing/core/mocking/mockLink.cjs",
    condition: "serverQuery",
    message: "Cannot mock a client-only query. Mocked responses should contain at least one non-client field."
  },

  27: {
    file: "@apollo/client/__cjs/testing/core/mocking/mockLink.cjs",
    condition: "(mock.maxUsageCount ?? 1) > 0",
    message: "Mocked response `maxUsageCount` must be greater than 0. Given %s"
  },

  28: {
    file: "@apollo/client/__cjs/react/ssr/prerenderStatic.cjs",
    condition: "renderCount <= maxRerenders",

    message: `Exceeded maximum rerender count of %d.
This either means you have very deep \`useQuery\` waterfalls in your application
and need to increase the \`maxRerender\` option to \`prerenderStatic\`, or that
you have an infinite render loop in your application.`
  },

  29: {
    file: "@apollo/client/__cjs/react/ssr/prerenderStatic.cjs",
    condition: "!signal?.aborted",
    message: "The operation was aborted before it could be attempted."
  },

  30: {
    file: "@apollo/client/__cjs/react/internal/cache/QueryReference.cjs",
    condition: "!queryRef || QUERY_REFERENCE_SYMBOL in queryRef",
    message: "Expected a QueryRef object, but got something else instead."
  },

  31: {
    file: "@apollo/client/__cjs/react/hooks/useApolloClient.cjs",
    condition: "!!client",

    message: 'Could not find "client" in the context or passed in as an option. ' +
        "Wrap the root component in an <ApolloProvider>, or pass an ApolloClient " +
        "instance in via options."
  },

  32: {
    file: "@apollo/client/__cjs/react/hooks/useLazyQuery.cjs",
    condition: "resultRef.current",
    message: "useLazyQuery: '%s' cannot be called before executing the query."
  },

  33: {
    file: "@apollo/client/__cjs/react/hooks/useLazyQuery.cjs",
    condition: "!calledDuringRender()",
    message: "useLazyQuery: 'execute' should not be called during render. To start a query during render, use the 'useQuery' hook."
  },

  34: {
    file: "@apollo/client/__cjs/react/hooks/useLoadableQuery.cjs",
    condition: "!calledDuringRender()",
    message: "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook."
  },

  35: {
    file: "@apollo/client/__cjs/react/hooks/useLoadableQuery.cjs",
    condition: "internalQueryRef",
    message: "The query has not been loaded. Please load the query."
  },

  36: {
    file: "@apollo/client/__cjs/react/hooks/useSubscription.cjs",
    condition: "!optionsRef.current.skip",
    message: "A subscription that is skipped cannot be restarted."
  },

  37: {
    file: "@apollo/client/__cjs/react/hooks/useSuspenseQuery.cjs",
    condition: "supportedFetchPolicies.includes(fetchPolicy)",
    message: `The fetch policy \`%s\` is not supported with suspense.`
  },

  40: {
    file: "@apollo/client/__cjs/react/context/ApolloConsumer.cjs",
    condition: "context && context.client",

    message: 'Could not find "client" in the context of ApolloConsumer. ' +
        "Wrap the root component in an <ApolloProvider>."
  },

  41: {
    file: "@apollo/client/__cjs/react/context/ApolloContext.cjs",
    condition: "\"createContext\" in React",

    message: "Invoking `getApolloContext` in an environment where `React.createContext` is not available.\n" +
        "The Apollo Client functionality you are trying to use is only available in React Client Components.\n" +
        'Please make sure to add "use client" at the top of your file.\n' +
        // TODO: change to React documentation once React documentation contains information about Client Components
        "For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
  },

  42: {
    file: "@apollo/client/__cjs/react/context/ApolloProvider.cjs",
    condition: "context.client",

    message: "ApolloProvider was not passed a client instance. Make " +
        'sure you pass in your client via the "client" prop.'
  },

  43: {
    file: "@apollo/client/__cjs/masking/maskDefinition.cjs",
    condition: "fragment",
    message: "Could not find fragment with name '%s'."
  },

  45: {
    file: "@apollo/client/__cjs/masking/maskFragment.cjs",
    condition: "fragments.length === 1",
    message: `Found %s fragments. \`fragmentName\` must be provided when there is not exactly 1 fragment.`
  },

  46: {
    file: "@apollo/client/__cjs/masking/maskFragment.cjs",
    condition: "!!fragment",
    message: `Could not find fragment with name "%s".`
  },

  47: {
    file: "@apollo/client/__cjs/masking/maskOperation.cjs",
    condition: "definition",
    message: "Expected a parsed GraphQL document with a query, mutation, or subscription."
  },

  49: {
    file: "@apollo/client/__cjs/link/utils/validateOperation.cjs",
    message: `illegal argument: %s`
  },

  50: {
    file: "@apollo/client/__cjs/link/persisted-queries/index.cjs",
    condition: "options &&\n    (typeof options.sha256 === \"function\" ||\n        typeof options.generateHash === \"function\")",

    message: 'Missing/invalid "sha256" or "generateHash" function. Please ' +
        'configure one using the "createPersistedQueryLink(options)" options ' +
        "parameter."
  },

  51: {
    file: "@apollo/client/__cjs/link/persisted-queries/index.cjs",
    condition: "forward",
    message: "PersistedQueryLink cannot be the last link in the chain."
  },

  52: {
    file: "@apollo/client/__cjs/link/http/checkFetcher.cjs",
    condition: "fetcher || typeof fetch !== \"undefined\"",

    message: `
"fetch" has not been found globally and no fetcher has been \
configured. To fix this, install a fetch package (like \
https://www.npmjs.com/package/cross-fetch), instantiate the \
fetcher, and pass it into your HttpLink constructor. For example:

import fetch from 'cross-fetch';
import { ApolloClient, HttpLink } from '@apollo/client';
const client = new ApolloClient({
  link: new HttpLink({ uri: '/graphql', fetch })
});
    `
  },

  54: {
    file: "@apollo/client/__cjs/link/http/parseAndCheckHttpResponse.cjs",
    condition: "response.body && typeof response.body.getReader === \"function\"",
    message: "Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`."
  },

  55: {
    file: "@apollo/client/__cjs/link/http/serializeFetchParameter.cjs",
    message: `Network request failed. %s is not serializable: %s`
  },

  57: {
    file: "@apollo/client/__cjs/link/core/ApolloLink.cjs",
    message: "request is not implemented"
  },

  58: {
    file: "@apollo/client/__cjs/core/ApolloClient.cjs",

    message: "To initialize Apollo Client, you must specify a 'cache' property " +
        "in the options object. \n" +
        "For more information, please visit: https://go.apollo.dev/c/docs"
  },

  59: {
    file: "@apollo/client/__cjs/core/ApolloClient.cjs",
    condition: "options.fetchPolicy !== \"cache-and-network\"",

    message: "The cache-and-network fetchPolicy does not work with client.query, because " +
        "client.query can only return a single result. Please use client.watchQuery " +
        "to receive multiple results from the cache and the network, or consider " +
        "using a different fetchPolicy, such as cache-first or network-only."
  },

  60: {
    file: "@apollo/client/__cjs/core/ApolloClient.cjs",
    condition: "options.query",

    message: "query option is required. You must specify your GraphQL document " +
        "in the query option."
  },

  61: {
    file: "@apollo/client/__cjs/core/ApolloClient.cjs",
    condition: "options.query.kind === \"Document\"",
    message: 'You must wrap the query string in a "gql" tag.'
  },

  62: {
    file: "@apollo/client/__cjs/core/ApolloClient.cjs",
    condition: "!options.returnPartialData",
    message: "returnPartialData option only supported on watchQuery."
  },

  63: {
    file: "@apollo/client/__cjs/core/ApolloClient.cjs",
    condition: "!options.pollInterval",
    message: "pollInterval option only supported on watchQuery."
  },

  65: {
    file: "@apollo/client/__cjs/core/LocalState.cjs",
    condition: "fragment",
    message: `No fragment named %s`
  },

  66: {
    file: "@apollo/client/__cjs/core/LocalState.cjs",
    condition: "fragment",
    message: `No fragment named %s`
  },

  68: {
    file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
    condition: "updateQuery",
    message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
  },

  70: {
    file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
    condition: "pollInterval",
    message: "Attempted to start a polling query without a polling interval."
  },

  72: {
    file: "@apollo/client/__cjs/core/QueryManager.cjs",
    message: "QueryManager stopped while query was in flight"
  },

  73: {
    file: "@apollo/client/__cjs/core/QueryManager.cjs",
    condition: "mutation",
    message: "mutation option is required. You must specify your GraphQL document in the mutation option."
  },

  74: {
    file: "@apollo/client/__cjs/core/QueryManager.cjs",
    condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
    message: "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."
  },

  75: {
    file: "@apollo/client/__cjs/core/QueryManager.cjs",
    message: "Store reset while query was in flight (not completed in link chain)"
  },

  79: {
    file: "@apollo/client/__cjs/core/QueryManager.cjs",
    condition: "didEmitValue",
    message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
  },

  80: {
    file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
    condition: "typeof dataId === \"string\"",
    message: "store.merge expects a string ID"
  },

  83: {
    file: "@apollo/client/__cjs/cache/inmemory/key-extractor.cjs",
    condition: "extracted !== void 0",
    message: `Missing field '%s' while extracting keyFields from %s`
  },

  84: {
    file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
    condition: "!old || old === which",
    message: `Cannot change root %s __typename more than once`
  },

  87: {
    file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
    message: "Cannot automatically merge arrays"
  },

  88: {
    file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
    message: `No fragment named %s`
  },

  89: {
    file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
    condition: "!(0, utilities_1.isReference)(value)",
    message: `Missing selection set for object of type %s returned for query field %s`
  },

  90: {
    file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
    message: `Could not identify object %s`
  },

  92: {
    file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
    message: `No fragment named %s`
  }
};

export const devDebug = {
  64: {
    file: "@apollo/client/__cjs/core/ApolloClient.cjs",
    message: `In client.refetchQueries, Promise.all promise rejected with error %o`
  },

  71: {
    file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
    message: `Missing cache result fields: %o`
  }
};

export const devLog = {};

export const devWarn = {
  6: {
    file: "@apollo/client/__cjs/utilities/graphql/directives.cjs",
    message: "@unmask 'mode' argument does not support variables."
  },

  7: {
    file: "@apollo/client/__cjs/utilities/graphql/directives.cjs",
    message: "@unmask 'mode' argument must be of type string."
  },

  8: {
    file: "@apollo/client/__cjs/utilities/graphql/directives.cjs",
    message: "@unmask 'mode' argument does not recognize value '%s'."
  },

  23: {
    file: "@apollo/client/__cjs/utilities/graphql/transform.cjs",

    message: "Removing an @connection directive even though it does not have a key. " +
        "You may want to use the key parameter to specify a store key."
  },

  38: {
    file: "@apollo/client/__cjs/react/hooks/useSuspenseQuery.cjs",
    message: "Using `returnPartialData` with a `no-cache` fetch policy has no effect. To read partial data from the cache, consider using an alternate fetch policy."
  },

  44: {
    file: "@apollo/client/__cjs/masking/maskDefinition.cjs",
    message: "Accessing unmasked field on %s at path '%s'. This field will not be available when masking is enabled. Please read the field from the fragment instead."
  },

  48: {
    file: "@apollo/client/__cjs/masking/utils.cjs",
    message: "The configured cache does not support data masking which effectively disables it. Please use a cache that supports data masking or disable data masking to silence this warning."
  },

  53: {
    file: "@apollo/client/__cjs/link/http/createHttpLink.cjs",
    message: "Multipart-subscriptions do not support @defer"
  },

  56: {
    file: "@apollo/client/__cjs/link/core/ApolloLink.cjs",
    message: `You are calling concat on a terminating link, which will have no effect %o`
  },

  67: {
    file: "@apollo/client/__cjs/core/ObservableQuery.cjs",

    message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
Did you mean to call refetch(variables) instead of refetch({ variables })?`
  },

  76: {
    file: "@apollo/client/__cjs/core/QueryManager.cjs",
    message: `Unknown query named "%s" requested in refetchQueries options.include array`
  },

  77: {
    file: "@apollo/client/__cjs/core/QueryManager.cjs",
    message: `Unknown anonymous query requested in refetchQueries options.include array`
  },

  78: {
    file: "@apollo/client/__cjs/core/QueryManager.cjs",
    message: '[%s]: Fragments masked by data masking are inaccessible when using fetch policy "no-cache". Please add `@unmask` to each fragment spread to access the data.'
  },

  81: {
    file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",

    message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
        "Please make sure to set the `mergeIntoStore` parameter to `true` when creating a Reference that is not part of the store yet:\n" +
        "`toReference(object, true)`"
  },

  82: {
    file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",

    message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
        "Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
  },

  85: {
    file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
    message: `Inferring subtype %s of supertype %s`
  },

  86: {
    file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
    message: `Undefined 'from' passed to readField with arguments %s`
  },

  93: {
    file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",

    message: `Cache data may be lost when replacing the %s field of a %s object.

This could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.

To address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:

  existing: %o
  incoming: %o

For more information about these options, please refer to the documentation:

  * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
  * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
`
  },

  94: {
    file: "@apollo/client/__cjs/cache/core/cache.cjs",
    message: "Could not identify object passed to `from` for '%s' fragment, either because the object is non-normalized or the key fields are missing. If you are masking this object, please ensure the key fields are requested by the parent object."
  }
};

export const devError = {
  22: {
    file: "@apollo/client/__cjs/utilities/graphql/transform.cjs",
    message: `Could not find operation or fragment`
  },

  39: {
    file: "@apollo/client/__cjs/react/hooks/useSyncExternalStore.cjs",
    message: "The result of getSnapshot should be cached to avoid an infinite loop"
  },

  69: {
    file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
    message: "Unhandled GraphQL subscription error"
  },

  91: {
    file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
    message: `Missing field '%s' while writing result %o`
  }
};
