You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After starting it up, connected both databases to corresponding consoles and created basic tables, then untrack them and via API add them back so they are federated, e.g.:
But there is no description of how should we tell hasura that there is some other type which we are extending
My very first attempt was to put it into actions (e.g. it wont resolve anything in either case)
But console does not allowing me to do so, complaining that given type is wrong:
The second attempt was with remote schema (which probably is not what we want here) but still it does not work, complaining that there are same _entity and _service fields 🤷♂️
Maybe it is possible by adding computed field to a books table and with help of postgres function do something around this, but I'm not sure what is a right way to create function itself e.g. one from docs expecting to have a table, but in our case there wont be any table and we will just resolve given ids always, e..g something like (pseudo code):
create function author(author_row author) {
return select author.author_id as id
}
create function author_books(author_row author) {
return select * from books where authori_id = author.author_id
}
The text was updated successfully, but these errors were encountered:
Hey @mac2000, thanks a lot for trying out the feature and raising the issue. Currently, the Apollo Federation support in Hasura does not allow you to extend Hasura types from other subgraphs (we recommend remote relationships for this). You can use Hasura types to extend types in other subgraphs though. You can checkout the RFC here, especially point 2:
Other subgraphs can use Hasura. At a minimum, this means that table types (generated by Hasura) should be available for other subgraphs.
We will add this to the documentation as well. Thanks again for pointing this out.
Hurray #3064 is here, so giving it a try
Trying to build the following graph:
Authors Service
Books Service
to do so I have prepared following docker compose:
docker-compose.yml
After starting it up, connected both databases to corresponding consoles and created basic tables, then untrack them and via API add them back so they are federated, e.g.:
Id do see tables in
{ _service { sdl } }
query response and can compose graph from both services with help of apollo federation:gateway.js
But there is no description of how should we tell hasura that there is some other type which we are extending
My very first attempt was to put it into actions (e.g. it wont resolve anything in either case)
But console does not allowing me to do so, complaining that given type is wrong:
The second attempt was with remote schema (which probably is not what we want here) but still it does not work, complaining that there are same _entity and _service fields 🤷♂️
Maybe it is possible by adding computed field to a books table and with help of postgres function do something around this, but I'm not sure what is a right way to create function itself e.g. one from docs expecting to have a table, but in our case there wont be any table and we will just resolve given ids always, e..g something like (pseudo code):
The text was updated successfully, but these errors were encountered: