-
Notifications
You must be signed in to change notification settings - Fork 3
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
include related fields in response other than custom FETCH #2
Comments
Hi,
You can see an example, where entities are artists and albums, here flask_autocrud/tests/test_custom.py Line 168 in 2f53dc1
Actually is not possible, with GET method, to fetch multiple related resources and applying filters on it. Let me know |
Hi @maikotz there is new release available. Now even multiple related resource are retrived with GET. curl -XGET 'http://127.0.0.1:5000/artist?_related=Album&_fields=Name&_no_links='
{
"ArtistList": [
{
"AlbumList": [
{
"AlbumId": 4
},
{
"AlbumId": 348
},
{
"AlbumId": 349
}
],
"ArtistId": 1,
"Name": "AC/DC"
},
{
"AlbumList": [
{
"AlbumId": 3
}
],
"ArtistId": 2,
"Name": "Accept"
}
]
} |
Hi,
first of all, thanks for the project!
Is it possible to include related fields in GET requests as well?
I want to use Apollo GraphQL on top but can't implement your custom FETCH method there.
My model is a company that has multiple arrays of id's (users, addresses, invoices, etc). These id's are on other microservices. With FETCH I can easily query them as related ressources.
Or am I missing another way here?
Best regards
models.py
curl --request FETCH call
{ "fields": [ "name" ], "related": { "addresses": [ "address_id" ] } }
The text was updated successfully, but these errors were encountered: