😸 Submitting my first RFCs to the GraphQL spec

— 2 minute read

I have just submitted my very first RFCs (Request For Comments) to the GraphQL spec:

  1. [RFC] Composable fields
  2. [RFC] Composable directives

The first one would enable to have fields compose other fields, like this:

query {
posts {
date: if(
condition: equals(
value1: lang,
value2: "ZH"
),
then: "Y-m-d",
else: if(
condition: equals(
value1: year(
date: date
),
value2: currentYear
),
then: "d/M",
else: "d/M/Y"
)
)
}
}

The second one would allow directives compose other directives using <> as syntax instead of @, like this:

query {
posts:posts(limit:10) {
tagNames
translatedTagNames:tagNames<
forEach<
translate(from:"en", to:"es")
>
>
}
}

I have already added these features on GraphQL by PoP (for instance: query solving the 1st issue, query solving the 2nd issue), and they have proved so powerful that I have no doubt that the GraphQL community could also benefit from them. They just make so much sense!

I wonder if they will be accepted? I certainly hope so! 😆