Comments (10)
To get a set of values based on id, you should use the BatchGetItem resolver operation as outlined here https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-batch.html. This is currently a bit tough to use when using multiple environments because you need to know the table name in the resolver and ideally would be encapsulated as a transformer such as @batchGet
. We have plans to open up the CLI such that you can run custom transformers and that would be the best way to get this working in a reproducible manner.
from amplify-category-api.
@mikeparisstuff, have there been any recent developments into making this work with multiple environments?
from amplify-category-api.
+1, is there any way to do this more easily now?
from amplify-category-api.
The batchGet is actually the best shot at doing this, although you will be limited to 100 items (https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchGetItem.html). The sole problem at the moment, however, is that as far as I know, we are not able to inject any environment variables such as the table name - which is required for the BatchGetItem - into the custom resolver.
This is supposedly tracked in #408.
Maybe somebody in the near future will find some time to dig deep into it and find a way to make this work.
Other than that, I think, you can pretty much only run the expensive scan with the filter expression.
Or instead, in case you are using GraphQL, you can run the list query with a filter. This should already be a scan with the filter, depending on where you want to have your logic for building the filter.
from amplify-category-api.
Oh, #415 ist also talking about this. I don't know, what the pricing implications are, but if you really need a batchGet
you can of course always lean back to a lambda for the resolver. Lambdas can be added with amplify add function
and detailed configuration which other resources access is required to.
from amplify-category-api.
any updates on this?
from amplify-category-api.
any updates on this?
from amplify-category-api.
Itβs 2023 already, any updates on this?
from amplify-category-api.
the future called and is asking for updates?
from amplify-category-api.
Yeah this is still needed
from amplify-category-api.
Related Issues (20)
- Dependency between custom stacks HOT 2
- groupsField ignored with Graphql HOT 2
- Can't use ref within customType in function returns HOT 3
- (npx ampx generate graphql-client-code): types are not generated from the schema. HOT 7
- [Gen2] 'Custom Identifier + ownerDefinedIn' Cause error: "Implicit field xx conflicts with the explicit field definition." HOT 3
- Cannot set enum to arguments in Function Mutation HOT 1
- Unable to identify DynamoDB tables in the sandbox environment for each user HOT 3
- SQLSchema - Optional belongsTo relationship breaks query/mutations HOT 4
- SQLSchema - Error: "contains" operator on scalar field is not allowed in auth filter HOT 7
- Why Why why Index ... does not exist for model OrgChatRoomMessage HOT 4
- Eventbridge Rule to graphql configuration problem HOT 2
- Amplify Gen 2 Data field-level authentication disables create on key field HOT 2
- AWS Amplify Gen 2 Data Set field-level authorization rule
- Add Array Support to CustomType in Gen2 Data Model HOT 1
- customType return type is null HOT 1
- Amplify Gen2 Schema Model Complexity Leads to TS2590 Error in TypeScript Client
- When connecting to mysql, a type error occurs in schema.sql.ts HOT 2
- [Documentation update]: amplifyEnvironmentName variable runtime context when performing cdk deploy HOT 1
- Expression produces a union type that is too complex to represent. HOT 1
- Improvements Needed for Modeling One-to-Many Relationships and Sorting in Amplify DataStore Gen 2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplify-category-api.