From 62b762d6691195bfe9a58aa2998a5e70902aa101 Mon Sep 17 00:00:00 2001 From: Sai Yenepalli Date: Thu, 16 Sep 2021 17:57:03 -0500 Subject: [PATCH] Added GraphQlList as sort type Need to sort on GraphQlList objects --- src/graphQLSortType.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/graphQLSortType.ts b/src/graphQLSortType.ts index 6e2eee8..169238f 100644 --- a/src/graphQLSortType.ts +++ b/src/graphQLSortType.ts @@ -1,4 +1,4 @@ -import { GraphQLInputObjectType, GraphQLEnumType, GraphQLNonNull, GraphQLObjectType, GraphQLInputType, GraphQLType, isLeafType, GraphQLInterfaceType } from 'graphql'; +import { GraphQLInputObjectType, GraphQLEnumType, GraphQLNonNull, GraphQLObjectType, GraphQLInputType, GraphQLType, isLeafType, GraphQLInterfaceType,GraphQLList } from 'graphql'; import { cache, setSuffix, getUnresolvedFieldsTypes, typesCache, FieldMap, GraphQLFieldsType } from './common'; export const FICTIVE_SORT = "_FICTIVE_SORT"; @@ -17,6 +17,10 @@ function getGraphQLSortTypeObject(type: GraphQLType, ...excludedFields): GraphQL type instanceof GraphQLInterfaceType) { return getGraphQLSortType(type, ...excludedFields); } + + if(type instanceof GraphQLList) { + return GraphQLSortType; + } return undefined; }