import { fromGlobalId } from 'common/utils' ; import { MutationToRenameTagResolver } from 'definitions' ; const resolver = async ( root , { input : { id , content } } , { viewer , dataSources : { tagService } } ) => { const { id : dbId } = fromGlobalId ( id ) ; const newTag = await tagService . renameTag ( { tagId : dbId , content } ) ; tagService . updateSearch ( { id : newTag . id , content : newTag . content , description : newTag . description , } ) ; return newTag ; } ; export default resolver ;