@@ -511,7 +511,10 @@ private GraphQLOutputType getGraphQLConnection(boolean isConnection, AccessibleO
511511 private boolean isConnection (AccessibleObject obj , Class <?> klass , GraphQLOutputType type ) {
512512 return obj .isAnnotationPresent (GraphQLConnection .class ) &&
513513 type instanceof GraphQLList &&
514- ((GraphQLList ) type ).getWrappedType () instanceof GraphQLObjectType ;
514+ (((GraphQLList ) type ).getWrappedType () instanceof GraphQLObjectType ||
515+ ((GraphQLList ) type ).getWrappedType () instanceof GraphQLInterfaceType ||
516+ ((GraphQLList ) type ).getWrappedType () instanceof GraphQLUnionType ||
517+ ((GraphQLList ) type ).getWrappedType () instanceof GraphQLTypeReference );
515518 }
516519
517520 protected GraphQLFieldDefinition getField (Method method ) throws GraphQLAnnotationsException {
@@ -708,7 +711,9 @@ public ConnectionDataFetcher(Class<? extends Connection> connection, DataFetcher
708711 @ Override
709712 public Object get (DataFetchingEnvironment environment ) {
710713 // Exclude arguments
711- DataFetchingEnvironment env = new DataFetchingEnvironmentImpl (environment .getSource (), new HashMap <>(), environment .getContext (),
714+ HashMap <String , Object > arguments = new HashMap <>(environment .getArguments ());
715+ arguments .keySet ().removeAll (Arrays .asList ("first" , "last" , "before" , "after" ));
716+ DataFetchingEnvironment env = new DataFetchingEnvironmentImpl (environment .getSource (), arguments , environment .getContext (),
712717 environment .getFields (), environment .getFieldType (), environment .getParentType (), environment .getGraphQLSchema (),
713718 environment .getFragmentsByName (), environment .getExecutionId (), environment .getSelectionSet ());
714719 Connection conn = constructNewInstance (constructor , actualDataFetcher .get (env ));
0 commit comments