Skip to content

Deprecation Warnings: Apollo Client canonizeResults and cache.diff Options #2209

@bpkennedy

Description

@bpkennedy

Description

Problem Description

During Next.js build process (next build), we're seeing deprecation warnings from Apollo Client 3.14.0 related to deprecated options canonizeResults and cache.diff. These warnings are being generated by Faust.js's internal Apollo Client usage during getWordPressProps calls.

Error Messages

The following warnings appear multiple times during the build output:

An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#%7B%22version%22%3A%223.14.0%22%2C%22message%22%3A104%2C%22args%22%3A%5B%22cache.diff%22%2C%22canonizeResults%22%2C%22Please%20remove%20this%20option.%22%5D%7D

Decoded error details:

  • Error Code: 104
  • Deprecated Options: cache.diff, canonizeResults
  • Message: "Please remove this option."

Environment

Frontend (Next.js)

Backend (WordPress)

  • WordPress Version: 6.6.1
  • FaustWP Plugin Version: 1.8.0

Root Cause

The warnings originate from Faust.js's internal Apollo Client instances created during:

  • getWordPressProps() calls in getStaticProps
  • Server-side rendering operations

These internal Apollo Client instances appear to be using deprecated options (canonizeResults and cache.diff) that were:

  • Deprecated in Apollo Client 3.11
  • Removed in Apollo Client 3.14

Impact

  • Build Status: ✅ Builds complete successfully (warnings only, not errors)
  • Functionality: ✅ No functional impact observed
  • Developer Experience: ⚠️ Build output is cluttered with repeated warnings

Steps to Reproduce

  1. Setup a Next.js project with Faust.js:

    # Install dependencies
    yarn add @faustwp/core@^3.0.1 @apollo/client@^3.10.5 next@^15.0.0
    
    # Add yarn resolution to ensure Apollo Client 3.14.0
    # In package.json:
    "resolutions": {
      "@apollo/client": "3.14.0"
    }
    
    yarn install
  2. Create a page using getWordPressProps:

    // pages/[...wordpressNode].tsx
    import { getWordPressProps, WordPressTemplate } from '@faustwp/core'
    import { GetStaticProps } from 'next'
    
    export default function Page(props) {
      return <WordPressTemplate {...props} />
    }
    
    export const getStaticProps: GetStaticProps = (ctx) => {
      return getWordPressProps({
        ctx,
        revalidate: 600,
      })
    }
  3. Run the build:

    yarn build
  4. Observe warnings in build output - The warnings will appear multiple times during static page generation, once for each page that uses getWordPressProps().

Note: The warnings only appear during build (next build), not during development (next dev). This is because getStaticProps runs during the build process.

Expected Behavior

  • No deprecation warnings during build
  • Faust.js's internal Apollo Client instances should use Apollo Client 3.14+ compatible options

Suggested Solution

Update Faust.js's internal Apollo Client configuration to:

  1. Remove any usage of canonizeResults option in InMemoryCache configuration
  2. Remove any usage of cache.diff method
  3. Ensure all InMemoryCache instances are created without deprecated options

Additional Context

We've already:

  • ✅ Updated our own Apollo Client instances to explicitly configure InMemoryCache without deprecated options
  • ✅ Added yarn resolution to ensure consistent Apollo Client version (@apollo/[email protected])
  • ✅ Verified warnings are coming from Faust.js's internal usage, not our code
  • ✅ Confirmed the warnings appear regardless of our own Apollo Client configuration

Verification:

  • We searched our codebase and confirmed we're not using canonizeResults or cache.diff anywhere
  • The warnings persist even after updating all our InMemoryCache instances to explicitly avoid deprecated options
  • The warnings only appear during build when getWordPressProps() is called, not during development

The warnings are non-blocking but should be addressed to maintain compatibility with Apollo Client 3.14+ and future versions.

Related Issues


Note: This is a good citizen issue report. We're happy to help test any fixes or provide additional information if needed.

Steps to reproduce

above

Additional context

above

@faustwp/core Version

3.3.2

@faustwp/cli Version

3.3.1

FaustWP Plugin Version

1.8.0

WordPress Version

6.6.1

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions