Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make includeDeprecated non nullable #1142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented Mar 4, 2025


In the same spirit as #1040, make includeDeprecated non-nullable in the introspection schema.

I don't think there is ever a reason to passe includeDeprecated: null?

Copy link

netlify bot commented Mar 4, 2025

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit 0f0967a
🔍 Latest deploy log https://app.netlify.com/sites/graphql-spec-draft/deploys/67c6ba7ef2ffe60008f3a797
😎 Deploy Preview https://deploy-preview-1142--graphql-spec-draft.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 configuration.

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

This is technically a breaking change if anyone did explicitly pass null to this field (unlikely):

{
  __schema {
    queryType {
      fields(includeDeprecated: null) {
        name
      }
    }
  }
}

but it's not a breaking change for existing queries that use nullable variables:

query I($includeDeprecated: Boolean) {
  __schema {
    queryType {
      fields(includeDeprecated: $includeDeprecated) {
        name
      }
    }
  }
}

unless of course you explicitly pass the variable set to null (unlikely).

One hesitation: if there are applications that use a query like the one above and use a system where null and not set are not differentiated (such as Facebook's system), then it's possible that they are passing null explicitly as the variable value. We should try and find out if such use-cases exist before accepting this.

@leebyron leebyron added 📄 Draft (RFC 2) RFC Stage 2 (See CONTRIBUTING.md) 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md) and removed 📄 Draft (RFC 2) RFC Stage 2 (See CONTRIBUTING.md) labels Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants