Skip to content

Configure required arguments with @listSize directive #15

@ErikWittern

Description

@ErikWittern

This library, by default, exposes variables for non-null arguments. However, many APIs rely on cursor connections, where one of the two slicing arguments first or last is required to be present. This constraint cannot be expressed with existing GraphQL constructs. In consequence, API providers like GitHub implement custom validation rules that ensure that exactly one of these arguments is present in a query.

IBM uses an @listSize SDL directive, applicable to field definitions, to identify possibly multiple slicing arguments, and to express that exactly one of them is required in a query. The idea is to publish a specification (similar to the cursor connections specification) about the exact nature of this directive, so that it can be used by GraphQL API providers for validation and query cost analysis.

This issue proposes that this library considers @listSize directives, if present, and exposes one of the required slicing argument. The feature would not impact any schema not using the directive, so it is an additional way to configure the behaviour of this library.

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