graphql / graphql/graphql-spec

Field extensions

Open
#1,162 1 comment 5 reactions 1 assignee Claimed by @egoodwinx View on GitHub
💭 Strawman (RFC 0)
Dominant language
JavaScript
Stars
14.6k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Not being able to add directives to an existing field definition has been a growing pain point in Apollo Kotlin. This RFC solves that.

* [~Spec edits~](https://github.com/graphql/graphql-spec/pull/1196) (closed)
* [GAP-4](https://github.com/graphql/gaps/pull/4/)
* [graphql-js PR](https://github.com/graphql/graphql-js/pull/4522)
* [apollo-kotlin PR](https://github.com/apollographql/apollo-kotlin/pull/6856)

See https://github.com/graphql/graphql-spec/issues/952 for the initial use case

## Current status

Object type extensions may extend existing fields.

In this example, we deprecate the field `id` on type `Query` by adding a
`@deprecated` directive:

```graphql example
type Query {
id: String
}
```

```graphql example
extend type Query {
id: String @deprecated(reason: "Use newId")
}
```

## Open questions

* Are extensions a merge? Or just additive?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.