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.

Auto resolve Datastore @connection fields

See original GitHub issue

Is your feature request related to a problem? Please describe.

When working with @connection in a relational DataStore model, I find myself having to loop through the results and manually resolve the connection fields one by one whereas with API.graphql I don’t have to.

Fetching Posts with comments @connection for examples requires me to: . Fetch all the posts . loop through the posts and for each post fetch the comments

Given the simplicity of Datastore API, the fetching is not a big deal if you have one @connection, but once you have many it starts to feel cumbersome.

Describe the solution you’d like It would be cool if Datastore automatically resolves the @connections the way API.graphql works.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
iartemievcommented, Dec 3, 2020

That’s correct, comments currently does not get populated. The docs specify retrieving them separately by passing in the related postID in the predicate.

We are currently working on a solution to retrieving related child items when querying a parent, so it will be possible to do in the near future.

1reaction
mdegreescommented, Mar 5, 2021

@undefobj thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataStore - Conflict resolution - JavaScript - AWS Amplify Docs
The default resolution is called Auto Merge . This strategy allows collections to grow, and prefers server-side versions of single-field data.
Read more >
Updating host names and port changes for source ...
Restart Access Server to ensure there are no users logged in. · Click Access Manager > Datastore Management. · Right-click the datastore and...
Read more >
Auto Resolve Integration Runtime can't connect to SQL ...
I created a basic tier SQL database in azure portal. Now trying to create a linked service to this sql database, but it's...
Read more >
Datastore Queries
A query retrieves entities from Firestore in Datastore mode that meet a specified set of conditions. The query operates on entities of a...
Read more >
Resolvers - Apollo GraphQL Docs
A resolver is a function that's responsible for populating the data for a single field in your schema. It can populate that data...
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