You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few ways we could write this, but this should work. My key condition expression is specifying items whose SK is less than (<) the SITE#${domain} sort key, so it will exclude the Site object whose sort key is exactly that.
Let me know if you think I'm still wrong! Taking a quick glance at it but I think it should be correct :)
Ah right so because the P comes before the S in the alphabet it is smaller and thus the posts are fetched. Is that assumption correct?
So if that is correct and you would introduce AUTHOR#{id} in the same partition those would also be fetched as a side effect of this query. Therefor I would personally use the begins_with(SK, :sk) and alter the :sk too POST#. This way you guarantee that you are only fetching posts in the getPostsForSite call.
I haven't tested your solution bus was looking at the implementation and I think there is an error in your template:
See:
graphql-dynamodb-single-table/lib/mapping-templates/Query.getPostsForSite.request.vtl
Line 8 in 23c5d95
Shouldn't the
SK
bePOST#
? The post is created withPOST#${id}
as sort key!The text was updated successfully, but these errors were encountered: