text: import { addCountry, findAll, findById, region } from '../domain/country';
  import {
    stixDomainEntityEditContext,
    stixDomainEntityCleanContext,
    stixDomainEntityEditField,
    stixDomainEntityAddRelation,
    stixDomainEntityDeleteRelation,
    stixDomainEntityDelete
  } from '../domain/stixDomainEntity';
  
  const countryResolvers = {
    Query: {
      country: (_, { id }) => findById(id),
      countries: (_, args) => findAll(args)
    },
    Country: {
      region: country => region(country.id)
    },
    Mutation: {
      countryEdit: (_, { id }, { user }) => ({
        delete: () => stixDomainEntityDelete(id),
        fieldPatch: ({ input }) => stixDomainEntityEditField(user, id, input),
        contextPatch: ({ input }) => stixDomainEntityEditContext(user, id, input),
        contextClean: () => stixDomainEntityCleanContext(user, id),
        relationAdd: ({ input }) => stixDomainEntityAddRelation(user, id, input),
        relationDelete: ({ relationId }) => stixDomainEntityDeleteRelation(user, id, relationId)
      }),
      countryAdd: (_, { input }, { user }) => addCountry(user, input)
    }
  };
  
  export default countryResolvers;
  