-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels