Skip to content

[Docs] Misleading description of paramsSerializer #5142

@denexapp

Description

@denexapp

Hi,

fetchBaseQuery accepts an optional paramsSerializer.

This docs page says that the params will be passed to URLSearchParams directly:

params will be given directly to new URLSearchParams()

But if we look at the code, in fact there's a default transformation happening - an internal stripUndefined function is applied.

This transformation doesn't apply if a custom paramsSerializer is provided.

This can lead to an unexpected behavior. If user provides a basic custom paramsSerializer that takes the params and passes them to a new URLSearchParams, its behavior is gonna be different from the default paramsSerializer, contrary to what the docs say.

The description of paramsSerializer should be updated to mention this behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions