---
title: "Discussion on \"How to Avoid Composite IDs in GraphQL with DynamoDB (feat. AppSync)\" | Hashnode"
description: "Discussion on \"How to Avoid Composite IDs in GraphQL with DynamoDB (feat. AppSync)\". Learn how not to expose composite DynamoDB keys to the GraphQL client."
url: "https://hashnode.com/posts/how-to-avoid-composite-ids-in-graphql-with-dynamodb-feat-appsync/61410610c5f31102b885d67f"
---

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

Discussion

# [How to Avoid Composite IDs in GraphQL with DynamoDB (feat. AppSync)](https://benoitboure.com/how-to-avoid-composite-ids-in-graphql-with-dynamodb-feat-appsync?utm_source=hashnode&utm_medium=feed)

Learn how not to expose composite DynamoDB keys to the GraphQL client.

Sep 14, 2021 · 4 min read · benoitboure.com  
Updated Mar 29, 2023  
Read the article

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

## 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 2

Markdown supported · ⌘↵ to post

[Patrick Werz](https://hashnode.com/@PatrickServerless)

[Jun 22, 2022](https://hashnode.com/posts/how-to-avoid-composite-ids-in-graphql-with-dynamodb-feat-appsync/61410610c5f31102b885d67f/comment/62b3852886d22092a754724c)

Hi Benoit, thanks for sharing. This trick (splitting up the Id) would still be possible without denormalizing the data, right?

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

[Jun 23, 2022](https://hashnode.com/posts/how-to-avoid-composite-ids-in-graphql-with-dynamodb-feat-appsync/61410610c5f31102b885d67f/comment/62b3852886d22092a754724c#reply-62b4345c92447c9aed5b17ce)

Do you mean without denormalizing an `id` attribute? Yes, it would still work. But keep in mind that it would be easier to return from the API if it comes pre-denormalized.

[Phillip Ninan](https://hashnode.com/@phillip_ninan)

[Sep 30, 2021](https://hashnode.com/posts/how-to-avoid-composite-ids-in-graphql-with-dynamodb-feat-appsync/61410610c5f31102b885d67f/comment/6155e407e896275f335df77e)

Great read Ben! This is actually a problem I have come across in the past and was unsure how to handle it. Thanks!
