-
Notifications
You must be signed in to change notification settings - Fork 63
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
Escaping double quotes in the @sql directive statement #901
Comments
Another Bug: -- getAllBrands.sql
Select brand_id as "brandId", brand_name as "brandName" from <Confidential>; type Query {
getAllBrands(userName: String!): [DBrand]
@sql(reference: "getAllBrands")
@auth(rules: [{ allow: public }])
} Calling this query from GraphQL client, throws the following error
|
I'm encountering this issue as well |
For the time being, you can modify the response resolver in the AppSync console for a query like the following:
|
Hi thanks for reporting this. There are 2 separate things being brought up here:
|
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v20.8.0
Amplify CLI Version
12.10.3
What operating system are you using?
WSL2
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
Followed this guide to manually create GraphQL api through CDK
https://docs.amplify.aws/javascript/build-a-backend/graphqlapi/connect-api-to-existing-database/
Describe the bug
I ran
npx @aws-amplify/cli api generate-schema --engine-type postgres
command to auto-generate GraphQL schema inschema.sql.graphql
This generated below mentioned type
I added below mentioned custom query in the same file
schema.sql.graphql
When I call the query using graphQl client in front-end, it throws the following error
However, when I renamed the fields(removed @refersTo mapping) to original DB filed names, it works.
Here is the additional change I made to test this
Added a new type DBrand2
Added duplicate of the original query but returning DBrand2 type instead
Expected behavior
Custom query results should be transformed to type generated by generate-schema command
Reproduction steps
npx @aws-amplify/cli api generate-schema --engine-type postgres
command for table that doesn't follow camel case attribute namesProject Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: