GraphQL error on Relay extensions schema: Name "__clientField" must not begin with "__", which is reserved by GraphQL introspection.
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
# Description
When we load the [Relay extensions schema](https://github.com/facebook/relay/blob/main/compiler/crates/relay-schema/src/relay-extensions.graphql) with the [graphql npm package](https://www.npmjs.com/package/graphql), we receive this error:
```
Name "__clientField" must not begin with "__", which is reserved by GraphQL introspection.
```
# Cause
The `__clientField` directive starts with 2 underscores
https://github.com/facebook/relay/blob/1eedeaa9b95075d5e8d22a13ee7b0523b57b863d/compiler/crates/relay-schema/src/relay-extensions.graphql#L80-L84
# Resources
http://spec.graphql.org/draft/#sec-Names.Reserved-Names
> Any [Name](http://spec.graphql.org/draft/#Name) within a GraphQL type system must not start with two underscores "__" unless it is part of the [introspection system](http://spec.graphql.org/draft/#sec-Introspection) as defined by this specification.
# Repro repo
https://github.com/christianvuerings/relay-repo-clientfield-issue/
Contributor guide
Research direction
Start with compiler/crates/relay-schema/src/relay-extensions.graphql at the __clientField directive referenced in the issue, then reproduce the validation error with the linked relay-repo-clientfield-issue repository and the graphql npm package. Done means the Relay extensions schema loads without the reserved-name error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100