import { GraphQLBoolean, 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: {
    id: {
      type: GraphQLInt,
    },
    accountId: {
      type: GraphQLInt,
    },
    displayName: {
      type: GraphQLString,
    },
    defaultPage: {
      type: GraphQLString,
    },
    type: {
      type: GraphQLString,
    },
    readOnlyInSelfServe: {
      type: GraphQLBoolean,
    },
    visibleInSelfServe: {
      type: GraphQLBoolean,
    },
    permissions: {
      type: new GraphQLList(GraphQLString),
    },
  },
});
