Skip to content
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

Subresource Population Settings Ignored in Updates #119

Open
martindale opened this issue Feb 29, 2016 · 3 comments
Open

Subresource Population Settings Ignored in Updates #119

martindale opened this issue Feb 29, 2016 · 3 comments
Labels
0.4 updates for @fabric/core ready

Comments

@martindale
Copy link
Member

When a Resource has a particular attribute configured to be "populated" for specific methods, these rules are not respected when the parent resource emits update events:

For example, from Melody:

var PostSchema = {
  content: { type: String },
  created: { type: Date , default: Date.now },
  _identity: { type: melody.mongoose.SchemaTypes.ObjectId , ref: 'Identity', required: true },
  _author: {
    type: melody.mongoose.SchemaTypes.ObjectId,
    ref: 'Person',
    populate: ['query', 'get']
  }
};

Perhaps handlers for the populate option should be expanded to include the update or patch methods.

@martindale
Copy link
Member Author

Alternatively, if resources contain pointers to other resources, perhaps the UX layer should always be the one handling this. Thoughts, @chrisinajar?

@chrisinajar
Copy link
Collaborator

What does the populate gesture do? It's probably a Data Layer or maybe Application State responsibility...

@martindale
Copy link
Member Author

The populate option indicates that, when a resource is retrieved in a specific context (query vs. get, for example), any references to other documents should be replaced with the actual documents themselves. It's a "hyperlink" to another, separate (but related) document.

I imagine that in the production deployment of Fabric, these will always be document hashes (the content-addressable part), but for now we are mainly using Mongo's ObjectIDs.

@martindale martindale added the 0.4 updates for @fabric/core label Jan 27, 2021
@martindale martindale added this to the 0.4: Implementation milestone Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.4 updates for @fabric/core ready
Projects
None yet
Development

No branches or pull requests

2 participants