New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
table.query is not a function #236
Comments
Table.* Doesn't work in function right now. You can use The reason is table.* Use the app sync contracts right now, we have a ticket to resolve this, but it's non trivial to recreate the next token and other parts of the app sync to dynamo contract. The larger issue is that lambda doesn't give an error at compile/synth time which I'll look into. |
Got it. I'll try that. |
I'm getting this error now
|
Is |
It supposed to be a reference to a Table. I used the field TableName for consistency with the AWS sdk. But in hindsight, that was likely confusing. We should change it. See #241 The reason it takes a reference is for type safety. |
@sam-goodwin Do you know how I can work around that error? |
Pass the table reference as TableName. Or do you mean the CFN synthesis error? First time seeing that, will take a look soon. |
The closure serializer serializes the entire table object. We attempt to remove unnecessary fields that don't serialize well, but it's a manual process to find them. After removing unnecessary fields, we try to turn all token into environment variables. And apparently env variables must eventually resolve to literal strings. Ran into this on Friday and had not figured out who to detect or normalize yet. |
For now, not using GSIs should bypass the issue. Will prioritize making the token serialization more robust. |
Even after removing the GSI, I'm still getting that error. |
Oh, you meant to remove the GSI from the table, I guess. That does bypass the issue. |
My list right now is...
Another big breaking change like #132 can follow async. |
I tried using
Table
inside aFunction
, and got this error. The generated code seems to be missing every method. Did I do this right?And here is the part of the generated code with the
__table
object.The text was updated successfully, but these errors were encountered: