Skip to content
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

fix: Polish examples on README #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ from graphene_federation import build_schema, key

@key("id")
class User(ObjectType):
id = Int(required=True)
id = ID(required=True)
username = String(required=True)

def __resolve_reference(self, info, **kwargs):
Expand All @@ -81,7 +81,7 @@ schema = build_schema(query=Query)
The product service exposes a `Product` type that can be used by other services via the `upc` field:

```python
from graphene import Argument, ID, Int, List, ObjectType, String
from graphene import Argument, Int, List, ObjectType, String
from graphene_federation import build_schema, key

@key("upc")
Expand All @@ -108,12 +108,12 @@ It also has the ability to provide the username of the `User`.
On top of that it adds to the `User`/`Product` types (that are both defined in other services) the ability to get their reviews.

```python
from graphene import Field, ID, Int, List, ObjectType, String
from graphene import Field, ID, List, ObjectType, String
from graphene_federation import build_schema, extend, external, provides

@extend("id")
class User(ObjectType):
id = external(Int(required=True))
id = external(ID(required=True))
reviews = List(lambda: Review)

def resolve_reviews(self, info, *args, **kwargs):
Expand Down