---
title: "Discussion on \"Write Reusable Code for AppSync JavaScript Resolvers\" | Hashnode"
description: "Discussion on \"Write Reusable Code for AppSync JavaScript Resolvers\". Learn how to share code between AppSync JS resolvers"
url: "https://hashnode.com/posts/write-reusable-code-for-appsync-javascript-resolvers/6405845d3de7f6cfae338c89"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Write Reusable Code for AppSync JavaScript Resolvers](https://blog.graphbolt.dev/write-reusable-code-for-appsync-javascript-resolvers?utm_source=hashnode&utm_medium=feed)

Learn how to share code between AppSync JS resolvers

Mar 6, 2023 · 7 min read · blog.graphbolt.dev  
Updated Mar 11, 2023  
Read the article

-   [#appsync](https://hashnode.com/tag/appsync)
-   [#graphql](https://hashnode.com/tag/graphql)
-   [#graphql-tools](https://hashnode.com/tag/graphql-tools)
-   [#serverless](https://hashnode.com/tag/serverless)
-   [#aws-appsync](https://hashnode.com/tag/aws-appsync)

## Written by

[Benoît Bouré](https://hashnode.com/@bboure)

@bboure · Remote

  
[View profile](https://hashnode.com/@bboure)

Software developer

👨‍💻 Sofware Engineer · 💬 Consultant · 🚀 Indie Maker · ⚡️ Serverless 🔧 serverless-appsync-plugin · serverless-appsync-simulator · middy-appsync 🐈 and 🍵

## Responses

Markdown supported · ⌘↵ to post

[Luiz Carlos Rodrigues](https://hashnode.com/@luizcarlos)

[Dec 16, 2023](https://hashnode.com/posts/write-reusable-code-for-appsync-javascript-resolvers/6405845d3de7f6cfae338c89/comment/657d99b19ceff72bc0c5b471)

That´s the perfect article. Really helpfull. I have a situation where I have an API that have different resolvers and functions and i want to reuse code inside different functions. I also have the build and deploy automated with Azure devops. When i use esbuild I understood that I need to bundle file per file, when you have 10 different functions that you need to bundle with reused code how would you approach that.

example:

/functions/getPolicy.js /functions/getAccounts.js /functions/GetRoles.js /helpers/log.js /resolvers/default.js

the link between the resolver and functions are make on the cloudformation file
