Skip to content

Single field subscriptions validator has conflicts with the spec #2715

Closed
@nikis05

Description

@nikis05

The rule: https://github.com/graphql/graphql-js/blob/master/src/validation/rules/OverlappingFieldsCanBeMergedRule.js

The spec states that subscriptions should have a single root field. Current implementation only checks that there is one selection on selection set of the subscription, not taking fragments into account. If a single selection is a fragment spread or an inline fragment (with multiple fields) this rule will wrongfully pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions