-
-
Notifications
You must be signed in to change notification settings - Fork 543
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
Apollo Federation Support #115
Comments
Another example, a bit more abstracted: import strawberry
import typing
@strawberry.federation.extend(keys=["upc"])
class Product:
upc: str = strawberry.federation.external_field()
reviews: typing.list["Review"]
@strawberry.federation.extend(keys=["id"])
class User:
id: strawberry.ID = strawberry.federation.external_field()
reviews: typing.list["Review"]
@strawberry.type
class Review:
body: str
author: User = strawberry.federation.provider_field("username")
product: Product
schema = strawberry.federation.FederatedSchema() |
I think |
I would like to help in any task available to give support to Apollo federation to strawberry. I personally prefer the first alternative as it is more easily translatable to the SDL |
Hello Patrick, the other day I looked over the PR and made some comments |
@Ambro17 don't see any comments 🤔 I saw your issue, but no comments on the PR |
My bad, I thought that merely writing the comments was enough, but apparently github requires to end your review with a comment/request changes/approve. Now you should be able to see my comments |
No worries! It happened to me as well a few times ^^ Thanks for the comments. By the way, I put federation on hold at the moment as I was trying to understand how to make a pagination API. By the way I was thinking of using discord and maybe livestream/pair with other people since we are all at home nowadays :D Here’s the link: https://discord.gg/ZkRTEJQ if you want to join ^^ |
@patrick91 Relay does pagination fairly well. I made a pagination that extends relay connection_type( where connection_type returns an object type with fields edges and page_info, edges is an array of types and page_info is a type that describes the results
|
@japrogramer did mean to write a comment here: #175? |
@patrick91 I was responding to your comment in this issue, was not aware of #175 |
@japrogramer my bad, I forgot what I wrote :D |
This is done, we'll add documentation and examples soon, I'll close this now 😊 |
Hey @patrick91! Any chance to get some docs on federation in the next time? |
Hi @Speedy1991 I have some docs here: #440 I wanted to make a full example[1], but didn't manage to make time, would you like to make one? We can put it in our strawberry-graphql/examples repo 😊 Feel free to join our discord and ask questions there too 😊 https://strawberry.rocks/discord [1] https://github.com/patrick91/strawberry-federation-demo |
Hi @patrick91, can you help me out with the N+1 problem in the federation? I have used the same approach given in the documentation of strawberry and it was extremely helpful, but I have observed that it's causing an N+1 problem, is there any example in which I can use Dataloader to resolve this issue. I tried using Dataloader but it seems when I try to use in Followings are my findings, they may help you: The last one is my method and it says it was never awaited and I am not calling it, I think it calls in strawberry. Thanks |
I was thinking of adding support for Apollo Federation, in order to make this happen the following TODOs need to be tackled:
not really true, but having a pythonic way of defining directives will help
Right now we only output fields that are used (directly and indirectly) in a query. Federated schemas might not define a query at all, so we need to output types anyway.
Federation specification
Federation spec: https://www.apollographql.com/docs/apollo-server/federation/federation-spec/
Python API
Initial Ideas
The text was updated successfully, but these errors were encountered: