Skip to content

__typename added multiple times when fragments used #12997

@strongpauly

Description

@strongpauly

Issue Description

One of the suggested mitigations for field duplication DDOS attacks (https://docs.ostorlab.co/kb/FIELD_DUPLICATION/index.html) is to reject any queries that contain duplicate fields. However, @apollo/client adds __typename multiple times when fragments are used meaning that if the suggested mitigation is implemented server side it would reject all queries using fragments.

Link to Reproduction

https://github.com/strongpauly/react-apollo-error-template

Reproduction Steps

See console.log in example repo.

@apollo/client version

4.0.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions