Skip to content

Remove deprecated info.field_nodes property#4213

Open
Ckk3 wants to merge 3 commits intostrawberry-graphql:mainfrom
Ckk3:deprecation/field-nodes
Open

Remove deprecated info.field_nodes property#4213
Ckk3 wants to merge 3 commits intostrawberry-graphql:mainfrom
Ckk3:deprecation/field-nodes

Conversation

@Ckk3
Copy link
Copy Markdown
Collaborator

@Ckk3 Ckk3 commented Feb 10, 2026

Description

Remove the deprecated info.field_nodes property from strawberry.Info, deprecated since 0.73.1.

Migration guide

Before (deprecated):

@strawberry.type
class Query:
    @strawberry.field
    def example(self, info: strawberry.Info) -> str:
        field_nodes = info.field_nodes
        ...

After:

@strawberry.type
class Query:
    @strawberry.field
    def example(self, info: strawberry.Info) -> str:
        selected_fields = info.selected_fields
        ...

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Summary by Sourcery

Remove the deprecated info.field_nodes API from strawberry.Info and document the migration to info.selected_fields.

Enhancements:

  • Clean up the Info type by dropping the deprecated field_nodes property in favor of selected_fields.

Documentation:

  • Add a release note with a migration guide for replacing info.field_nodes with info.selected_fields.

Tests:

  • Remove the deprecation test that asserted info.field_nodes emitted a DeprecationWarning.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Feb 10, 2026

Reviewer's Guide

Removes the deprecated Info.field_nodes property from Strawberry’s GraphQL execution info type, cleans up associated typing/imports and tests, and documents the migration to Info.selected_fields in the release notes.

File-Level Changes

Change Details Files
Remove deprecated Info.field_nodes API and its implementation from the core Info type.
  • Delete the field_nodes property on the Info class, including its deprecation warning and access to the underlying GraphQLResolveInfo.field_nodes.
  • Remove the now-unused FieldNode type import from the TYPE_CHECKING block.
  • Rely on the existing selected_fields cached_property as the replacement API.
strawberry/types/info.py
Drop tests that asserted the field_nodes deprecation behavior.
  • Remove the test that accessed info.field_nodes and asserted that a DeprecationWarning is emitted.
  • Keep all remaining Info-related tests intact.
tests/schema/test_info.py
Add release notes documenting the breaking removal and migration path.
  • Introduce a RELEASE.md entry marking this as a minor release.
  • Document the migration from info.field_nodes to info.selected_fields with before/after code examples and link to the original deprecation release (0.73.1).
RELEASE.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Ckk3 Ckk3 self-assigned this Feb 10, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 10, 2026

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing Ckk3:deprecation/field-nodes (8047e82) with main (e1ef11a)

Open in CodSpeed

@Ckk3 Ckk3 marked this pull request as ready for review February 15, 2026 19:32
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@botberry
Copy link
Copy Markdown
Member

botberry commented Feb 15, 2026

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


Remove deprecated info.field_nodes property, deprecated since 0.73.1.

Migration guide

Before (deprecated):

@strawberry.type
class Query:
    @strawberry.field
    def example(self, info: strawberry.Info) -> str:
        field_nodes = info.field_nodes
        ...

After:

@strawberry.type
class Query:
    @strawberry.field
    def example(self, info: strawberry.Info) -> str:
        selected_fields = info.selected_fields
        ...

Here's the tweet text:

🆕 Release (next) is out! Thanks to Luis Gustavo for the PR 👏

Get it here 👉 https://strawberry.rocks/release/(next)

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 15, 2026

Greptile Summary

Removes the deprecated info.field_nodes property from strawberry.types.info.Info, which has been deprecated since v0.73.1. The replacement info.selected_fields has been available and recommended since then.

  • Removed the field_nodes property (and its deprecation warning) from the Info class in strawberry/types/info.py
  • Cleaned up the now-unused warnings and FieldNode imports
  • Removed the corresponding deprecation test in tests/schema/test_info.py
  • Added a RELEASE.md with a minor release type and migration guide
  • Internal uses of field_nodes on the native GraphQLResolveInfo object (in strawberry/extensions/directives.py, strawberry/schema/schema.py, and tests) are unaffected, as they access the graphql-core attribute directly rather than the removed Strawberry wrapper

Confidence Score: 5/5

  • This PR is safe to merge — it cleanly removes a long-deprecated property with no remaining internal or test dependencies.
  • The change is minimal and well-scoped: it removes a deprecated property, its imports, and its test. All other references to field_nodes in the codebase use the native GraphQLResolveInfo.field_nodes attribute (not the removed Strawberry wrapper), so no breakage is expected. The release note includes a clear migration guide.
  • No files require special attention.

Important Files Changed

Filename Overview
RELEASE.md New release note file (minor release type) with clear migration guide from info.field_nodes to info.selected_fields.
strawberry/types/info.py Removes the deprecated field_nodes property, the warnings import, and the FieldNode type import. All removals are clean with no remaining references to the removed code.
tests/schema/test_info.py Removes the test_field_nodes_deprecation test that validated the deprecation warning for the now-removed property. Remaining tests cover selected_fields usage adequately.

Flowchart

flowchart TD
    A["strawberry.Info (before)"] --> B["info.field_nodes (deprecated)"]
    A --> C["info.selected_fields"]
    B --> D["warnings.warn() + return _raw_info.field_nodes"]
    C --> E["convert_selections(_raw_info, _raw_info.field_nodes)"]
    
    F["strawberry.Info (after)"] --> G["info.selected_fields"]
    G --> E
    
    style B fill:#ff6b6b,color:#fff
    style D fill:#ff6b6b,color:#fff
    style G fill:#51cf66,color:#fff
    style E fill:#51cf66,color:#fff
Loading

Last reviewed commit: 0e397e2

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@patrick91 patrick91 added this to the V1 milestone Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants