Skip to content

[RFC] @skip/include directive: ability to define default/fallback value #475

Open
@slorber

Description

@slorber

Let's say my app have a React component with an associated GraphQL fragment.

This fragment is used in 10 distinct queries. As of today, field x always has to be fetched, but a new business requirement ask to not fetch this field, just for one of the 10 queries.

I can add the following to my fragment:

x @skip(if: $skipX)

But now, I have to provide a $skipX variable for all of my 10 queries, which seem doable but annoying.

I've like to have a syntax like

x @skip(if: $skipX = false)

so that I only have to modify the variables of a single query

What do you think about this?

Is there any alternative to my need which does not require modifying all my existing queries?

Metadata

Metadata

Assignees

No one assigned

    Labels

    👻 Needs ChampionRFC Needs a champion to progress (See CONTRIBUTING.md)💭 Strawman (RFC 0)RFC Stage 0 (See CONTRIBUTING.md)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions