import { GraphQLInputObjectType, GraphQLInt, GraphQLList, GraphQLString } from 'graphql';

import { createModuleNameFromMetaUrl } from '../../../../_helpers/common';

export const PAYLOAD_NAME: string = createModuleNameFromMetaUrl(import.meta.url);

export default new GraphQLInputObjectType({
  name: PAYLOAD_NAME,
  fields: {
    sortBy: {
      type: GraphQLString,
    },
    sortOrder: {
      type: GraphQLString,
    },
    page: {
      type: GraphQLInt,
    },
    pageSize: {
      type: GraphQLInt,
    },
    searchText: {
      type: GraphQLString,
    },
    searchIn: {
      type: new GraphQLList(GraphQLString),
    },
    filters: {
      type: new GraphQLList(GraphQLString),
    },
    filtersValues: {
      type: new GraphQLList(GraphQLInt),
    },
  },
});
