Skip to content

Expand @deprecated to Object types#3818

Open
fotoetienne wants to merge 1 commit intographql:nextfrom
fotoetienne:deprecated-objects
Open

Expand @deprecated to Object types#3818
fotoetienne wants to merge 1 commit intographql:nextfrom
fotoetienne:deprecated-objects

Conversation

@fotoetienne
Copy link
Copy Markdown
Contributor

See RFC

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 6, 2023

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit 442e57b
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/63b7d3141fb4c60009ad6e99
😎 Deploy Preview https://deploy-preview-3818--compassionate-pike-271cb3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@yaacovCR yaacovCR added the spec RFC Implementation of a proposed change to the GraphQL specification label Jan 12, 2023
@fotoetienne fotoetienne requested a review from IvanGoncharov June 1, 2023 16:43
@IvanGoncharov IvanGoncharov requested a review from a team June 1, 2023 18:43
Copy link
Copy Markdown
Member

@IvanGoncharov IvanGoncharov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 20, 2026

@fotoetienne is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Add support for @deprecated directive on OBJECT type definitions.

- Add deprecationReason to GraphQLObjectType class and config
- Add OBJECT to @deprecated directive locations
- Add isDeprecated/deprecationReason to __Type introspection
- Add includeDeprecated argument to __Schema.types and __Type.possibleTypes
- Add objectDeprecation option to getIntrospectionQuery
- Parse @deprecated on object types from SDL (extendSchema, buildClientSchema)
- Print @deprecated on object types (printSchema)
- Add schema validation: non-deprecated fields cannot return deprecated types
- Add NoDeprecatedCustomRule: detect deprecated type usage in inline fragments
  and fragment definitions
@fotoetienne
Copy link
Copy Markdown
Contributor Author

fotoetienne commented Feb 20, 2026

Rebased onto latest next and addressed the review feedback:

Schema validation (validate.ts):

  • Non-deprecated fields that return a deprecated object type now produce a validation error, ensuring the schema remains valid when deprecated types are filtered from introspection.

Query validation (NoDeprecatedCustomRule.ts):

  • InlineFragment — reports usage of deprecated types via ... on DeprecatedType
  • FragmentDefinition — reports usage of deprecated types via fragment Foo on DeprecatedType

All existing tests pass, new tests added for both validation rules

Resolves graphql/graphql-wg#1353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec RFC Implementation of a proposed change to the GraphQL specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants