File tree Expand file tree Collapse file tree 3 files changed +15
-43
lines changed
main/java/graphql/annotations
test/java/graphql/annotations Expand file tree Collapse file tree 3 files changed +15
-43
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ public GraphQLOutputType getOutputType(Class<?> object) throws GraphQLAnnotation
270270 } else if (Enum .class .isAssignableFrom (object )) {
271271 type = getEnumBuilder (object ).build ();
272272 } else {
273- type = new GraphQLObjectTypeWrapper ( object , getObjectBuilder (object ).build () );
273+ type = getObjectBuilder (object ).build ();
274274 }
275275
276276 typeRegistry .put (typeName , type );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2828import graphql .schema .GraphQLObjectType ;
2929import graphql .schema .GraphQLSchema ;
3030import graphql .schema .GraphQLType ;
31+ import graphql .schema .idl .SchemaParser ;
32+ import graphql .schema .idl .SchemaPrinter ;
33+ import graphql .schema .idl .TypeDefinitionRegistry ;
3134import org .testng .annotations .BeforeMethod ;
3235import org .testng .annotations .Test ;
3336
@@ -154,8 +157,17 @@ public void metainformation() {
154157 @ Test
155158 public void objectClass () {
156159 GraphQLObjectType object = GraphQLAnnotations .object (TestObject .class );
157- assertTrue (object instanceof GraphQLObjectTypeWrapper );
158- assertEquals (((GraphQLObjectTypeWrapper ) object ).getObjectClass (), TestObject .class );
160+ assertTrue (object instanceof GraphQLObjectType );
161+ }
162+
163+ @ Test
164+ public void testSchema () {
165+ GraphQLObjectType object = GraphQLAnnotations .object (TestObject .class );
166+ String schema = new SchemaPrinter ().print (object );
167+ assertTrue (schema .contains ("type TestObject {" ));
168+ TypeDefinitionRegistry reg = new SchemaParser ().parse (schema );
169+ assertTrue (reg .getType ("TestObject" ).isPresent ());
170+ assertEquals (new SchemaParser ().parse (schema ).getType ("TestObject" ).get ().getChildren ().size (), 8 );
159171 }
160172
161173 @ Test
You can’t perform that action at this time.
0 commit comments