graphql / graphql/graphiql

[graphiql] Make GraphiQL robust to new built-in types being added

Open
#3,968 0 comments 1 reaction 0 assignees View on GitHub
bug graphiql
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

Follow up from [discord](https://discord.com/channels/625400653321076807/971515695881924621/1367379788376838144)

As we are investigating adding new built-in types to GraphQL, this breaks GraphiQL with the following error:

![Image](https://github.com/user-attachments/assets/005cea9b-3512-44aa-8695-20dbaae35f21)

Looks like adding any type starting with `__` will trigger an error. This is problematic as it forbids evolution of the specification.

This happens when calling `validateSchema()` because the `@behaviour` is seen as a custom directive using a reserved type.

It's too late to change the past but fixing this sounds important for the soundness of the ecosystem for the many years to come.

Edit: looks like this will require some functionality in graphql-js: https://github.com/graphql/graphql-js/issues/4415

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.