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

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

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

export default new GraphQLInputObjectType({
  name: PAYLOAD_NAME,
  fields: {
    userId: {
      type: GraphQLInt,
    },
    accountId: {
      type: GraphQLInt,
    },
    expirationDate: {
      type: GraphQLFloat,
    },
    resources: {
      type: new GraphQLList(GraphQLString),
    },
    isExpirationDateActive: {
      type: GraphQLBoolean,
    },
  },
});
