question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataStore does not support connection directive with keyName

See original GitHub issue

Which 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:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
faris-sacommented, Apr 27, 2020

after upgrading amplify CLI to version: @aws-amplify/cli@4.18.1 I received this error: DataStore does not support connection directive with keyName

5reactions
yuthcommented, Apr 30, 2020

@apoorvmote

My question is “Is this permanant change? or you have plans to support connection directive with keyName for datastore in future?”

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found