Create Example Project / Usage
Opened this issue · 4 comments
Create a Mono repo of:
- Frontend Project
- Admin Project
- Postgraphile Backend
The Project should have a simple Use Case (e.g. a Blog).
Features:
- Authentication
I created this example project https://github.com/stephane-klein/react-admin-and-postgraphile-playground based on https://github.com/BowlingX/ra-postgraphile
Thank you very much :).
Regarding documentation/examples, one common pattern I haven't figured out is if there's a more efficient way to represent nested properties / join queries like this:
Postgraphile query:
user(id: "1") {
name
userResources {
nodes {
added
resource {
name
}
}
}
}
userResources
is a join table between user and resource. You would imagine the admin table would be resource.name | userResource.added
under the user. It seems like react-admin encourages use of <ReferenceField>
, but this fires off separate requests.
Yes, that's the concept of react-admin, because it comes from a more REST centric idea. Currently, we do not expose entities like that, if we detect an object we do not expand it automatically. You can change this behaviour by specifying the Type at queryValueToInputValueMap
. (See https://github.com/BowlingX/ra-postgraphile#configuration). As this is currently quite limiting, I want to add a better configuration method were it's also possible to pass arguments to possible fields.