Skip to content

@graphql-tools/wrap: Nested variable input types are not treated as input types  #4300

Open
@avinashbot

Description

@avinashbot

Describe the bug

When calling wrapSchema on a schema, the resulting schema breaks when input types provided by a variable are nested inside input types provided in the query directly, with an error message that goes like Variable "$input" expected value of type "DefinitelyAnInputType!" which cannot be used as an input type.. You can see the message in the repro below. When wrapSchema is removed, it works perfectly fine.

To Reproduce
Steps to reproduce the behavior:

I couldn't narrow this down to a version or a commit. It looks like GraphQL's isInputType is returning true for these types, so I have no idea where this error is coming from at all.

Expected behavior

For it to behave like the original schema (i.e. not throw an error).

Environment:

  • OS: Any
  • @graphql-tools/schema: 8.3.2
  • @graphql-tools/wrap: 8.4.3
  • graphql: 16.3.0
  • NodeJS: 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions