Skip to content

Schema generator reports false positive unsatisfiable input object cycle #4214

Closed

Description

@RafeArnold

Per the spec, cyclic input object fields of non-nullable list type with non-nullable items are valid since the field value can be an empty list. However, the NoUnbrokenInputCycles rule reports these input objects as invalid.

To reproduce, run the following code:

import graphql.schema.idl.NoopWiringFactory;
import graphql.schema.idl.RuntimeWiring;
import graphql.schema.idl.SchemaGenerator;
import graphql.schema.idl.SchemaParser;

public class Main {
    public static void main(String[] args) {
        String query = """
                  input Example {
                    self: [Example!]!
                    value: String
                  }
                
                  type Query {
                    example(example: Example): String
                  }
                """.stripIndent();
        TypeDefinitionRegistry typeDefinitionRegistry = new SchemaParser().parse(query);
        RuntimeWiring runtimeWiring = RuntimeWiring.newRuntimeWiring().wiringFactory(new NoopWiringFactory()).build();
        new SchemaGenerator().makeExecutableSchema(typeDefinitionRegistry, runtimeWiring);
    }
}

Observe an InvalidSchemaException is thrown with the message [self!] forms an unsatisfiable cycle

Activity

  1. added a commit that references this issue on Mar 9, 2026
    2cca660
  2. github-actions commented on Mar 25, 2026

    @github-actions
    Contributor

    Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.

  3. RafeArnold commented on Mar 25, 2026

    @RafeArnold
    ContributorAuthor

    2cca660 appears to be a fix for this issue. Is it possible for this to be merged, @dondonz?

  4. added
    keep-openTells Stale Bot to keep PRs and issues open
    and removed on Mar 25, 2026
  5. dondonz commented on Mar 25, 2026

    @dondonz
    Member

    Hello thanks for reporting, will come back to this shortly

  6. andimarek commented on May 19, 2026

    @andimarek
    Member

    Verified against current master: this is still reproducible. Adding the SDL regression test for the issue fails with [self!] forms an unsatisfiable cycle before the fix.

    Opened #4386 with the fix and regression coverage.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    keep-openTells Stale Bot to keep PRs and issues open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions