Skip to content

fix: generated mutation fields get query descriptions #398

Closed

Description

@gazorby

StrawchemyField.description (src/strawchemy/schema/field.py:667-681) builds its "Fetch … from the X collection" template for every field. The mutation field classes in src/strawchemy/schema/mutation/fields.py don't override it, so generated mutations get query descriptions.

Evidence, from tests/unit/mapping/__snapshots__/test_schemas/test_query_and_mutations.gql:144:

"""Fetch object from the FruitType collection by id"""
createFruit(data: FruitInput!): FruitType!

test_plain_type_fields_accepted.gql shows the same for createColor, createColors and createPlain. Fields with a custom resolver that return a plain Strawberry type (e.g. plain: [Plain!]!) also get a "Fetch objects from the Plain collection" description, although Strawchemy fetches nothing for them.

Expected: mutation fields get a mutation-specific description (or none), and resolver fields returning a non-Strawchemy type get none.

Activity

  1. added a commit that references this issue on Sep 30, 2026
  2. gazorby commented on Sep 30, 2026

    @gazorby
    OwnerAuthor

    Fixed in #403.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions