-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Description
Having this simple schema:
schema {
query: Query
}
type Query {
animal: Animal
}
interface Animal {
type: ComplexType
}
type Dog implements Animal {
type: ComplexType
}
type ComplexType {
id: String
}and data classes:
class QueryResolver implements GraphQLQueryResolver {
Animal animal(){}
}
interface Animal {
ComplexType type
}
class Dog implements Animal {
}
class ComplexType {
String id
}This error pop up when building the schema:
Caused by: com.coxautodev.graphql.tools.SchemaError: Expected type 'ComplexType' to be a GraphQLOutputType, but it wasn't! Was a type only permitted for object types incorrectly used as an input type, or vice-versa?
at com.coxautodev.graphql.tools.SchemaParser.determineType(SchemaParser.kt:248)
at com.coxautodev.graphql.tools.SchemaParser.determineOutputType(SchemaParser.kt:234)
at com.coxautodev.graphql.tools.SchemaParser.createField(SchemaParser.kt:206)
at com.coxautodev.graphql.tools.SchemaParser.access$createField(SchemaParser.kt:48)
at com.coxautodev.graphql.tools.SchemaParser$createInterfaceObject$$inlined$forEach$lambda$1.apply(SchemaParser.kt:179)
at com.coxautodev.graphql.tools.SchemaParser$createInterfaceObject$$inlined$forEach$lambda$1.apply(SchemaParser.kt:48)
at graphql.schema.GraphQLInterfaceType$Builder.field(GraphQLInterfaceType.java:136)
at com.coxautodev.graphql.tools.SchemaParser.createInterfaceObject(SchemaParser.kt:179)
at com.coxautodev.graphql.tools.SchemaParser.parseSchemaObjects(SchemaParser.kt:78)
at com.coxautodev.graphql.tools.SchemaParser.makeExecutableSchema(SchemaParser.kt:103)
at com.coxautodev.graphql.tools.SchemaParserInterface.should parse interface with complex type(SchemaParserInterface.groovy:40)
It went well when after changing Animal from interface to type in schema.
Metadata
Metadata
Assignees
Labels
No labels