DataStore does not support connection directive with keyName
See original GitHub issueWhich Category is your question related to? Datastore
Amplify CLI Version 4.18.0
What AWS Services are you utilizing? API, Cognito
Provide additional details e.g. code snippets Following schema used to work. But doesn’t work anymore.
type Blog @model
@auth(rules: [
{allow: owner}
]) {
id: ID!
title: String!
owner: String!
comments: [Comment] @connection(keyName: "byBlog", fields: ["id"])
}
type Comment @model
@auth(rules: [
{allow: owner}
])
@key(name: "byBlog", fields: ["blogID"]) {
id: ID!
owner: String!
content: String!
blogID: ID!
}
Now if I do amplify codegen models
I get following error
Error: DataStore does not support connection directive with keyName
My question is “Is this permanant change? or you have plans to support connection directive with keyName for datastore in future?”
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:16 (4 by maintainers)
Top Results From Across the Web
API (GraphQL) - Add relationships between types - Amplify Docs
The @connection directive enables you to specify relationships between @model types. Currently, this supports one-to-one, one-to-many, and many-to-one ...
Read more >Connect Amplify DataStore with existing SQL datasources
I am going to build a backend that accesses two tables ( Posts and Comments ) in an existing Aurora MySQL database. These...
Read more >GraphQL Transform - GitHub Pages
The @key directive makes it simple to configure custom index structures for @model types. Amazon DynamoDB is a key-value and document database that...
Read more >How to create a many to many relationship in amplify ...
You need to omit keyName from Course , since in Student model, you have list of courses, so you can't really have @key...
Read more >Fix list for IBM WebSphere Application Server V8.5
Install, PH32486, Applications button of Suse GUI is not displayed after install ... IT38158, Connection handle leak when a MQ-JMS application security exit ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
after upgrading amplify CLI to version: @aws-amplify/cli@4.18.1 I received this error: DataStore does not support connection directive with keyName
@apoorvmote
The DataStore client libraries never supported keyName, and model gen did not flag this. We updated the model gen to throw this as an error so that there are no surprises at later at run time. This change is not permanent and we do have plans to support
keyName
in future releases