Skip to content

[graphiql] Input Object type ... must define one or more fields. #4115

@robross0606

Description

@robross0606

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If an input type has only one field in it that is deprecated, GraphiQL throws an error. For example, with this schema:

"Input type used to update an existing Study Activity Item."
input StudyActivityItemDetailUpdateInput {
  "The preferred display name for this item."
  displayName: String  @deprecated(reason: "Use `updateScheduledActivity()` with `ScheduledActivityUpdateInput.displayName` instead.")
}

GraphiQL throws errors in multiple places and becomes unusable for documentation:

Image

It is still possible to successfully run queries. It seems like GraphiQL is maybe filtering out deprecated fields and then validating the schema without them. Insomnia and other tools have no such problem.

Expected Behavior

GraphiQL should now show and error about validation since this field still exists, but is deprecated.

Steps To Reproduce

  1. Create an input type with one one field in it.
  2. Mark that field as @deprecated.
  3. Load the schema in GraphiQL.

Environment

  • GraphiQL Version: Unknown since I cannot find that information in the minified CDN bundle or in the UI.
  • OS: Any
  • Browser: Chrome
  • Bundler: CDN
  • react Version: None
  • graphql Version: 15

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions