apollo-rs icon indicating copy to clipboard operation
apollo-rs copied to clipboard

Names must not start with two underscores `__`

Open qwerdenkerXD opened this issue 1 year ago • 6 comments

Description

The Specification declares the following:

# Reserved Names
Any Name within a GraphQL type system must not start with two underscores "__"
unless it is part of the introspection system as defined by this specification.

Currently, this is not satisfied by [email protected] and has been forgotten in PR #713

Steps to reproduce

Validate the following schema which has some of such invalid names defined:

type Query {
  __field(__arg: __MyScalar!): __MyType!
}

type __MyType {}

interface __MyInterface {}

scalar __MyScalar

enum __MyEnum {
  __EnumValue
}

union __MyUnion = __MyType | __Schema

input __MyInput {
  __field: __MyScalar!
}

Here a code sample.

Expected result

The validation should fail and have some respective diagnostics.

Actual result

The validation succeeds.

Environment

  • Operating system and version: Ubuntu 20.04.6 LTS
  • Shell (bash/zsh/powershell): zsh
  • apollo-rs crate: apollo-compiler
  • Crate version: 1.0.0-beta.6

qwerdenkerXD avatar Nov 15 '23 11:11 qwerdenkerXD