-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support Firestore sub-collections #46
Comments
@jthegedus Wow! Thanks for the detailed information! IMO, in GQLify, type Book @GQLifyModel(dataSource: "firestore", key: "books") {
id: ID! @unique @autoGen
title: String!
author: Author! @GQLifySubResource(key: "authors")
}
type Author {
id: ID! @unique @autoGen
name: String!
}
|
Brilliant idea! Much more flexible across Do you foresee any issues with the naming convention of: Some more ideas to think about: presumably the SubResource is always contained in the same datasource as the parent type? Would there be a need for otherwise? |
Well, regarding the naming convention, I doubt anyone would put subcollection so nested (ex: As for |
@wwwy3y3 I agree completely, just wanted to raise the thoughts. I think |
@jthegedus We're always glad to hear thoughts from the community 😄 Please don't hesitate to share your thoughts. Hope to hear more from you when we release |
Is your feature request related to a problem? Please describe.
It is unclear at this time how to use firestore subcollections with
@gqlify/firestore
.Describe the solution you'd like
I imagine creating the type like so:
and then updating or creating a field requires a
where
params list like so:or could we use a Firestore sub-collection specific
where
param where theid
field is the document path? Eg:where the
parentPath
is more like the current path usage in Firestore SDK:Issues with this solution:
books/*/authors
work well enough?Describe alternatives you've considered
Using root-level Firestore collections is a viable alternative since relationships/foreign-keys are already supported. There are performance implications with doing so though where sub-collections would be desirable.
Additional context
Just starting a discussion of the idea 😄
The text was updated successfully, but these errors were encountered: