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

Add Graphql Types #279

Closed
gdvalderrama opened this issue Jun 28, 2023 · 3 comments
Closed

Add Graphql Types #279

gdvalderrama opened this issue Jun 28, 2023 · 3 comments

Comments

@gdvalderrama
Copy link

This is a feature request.

Consider adding Graphql types for the models.

Other apps, like django countries, offer graphql types for their models, example.

The type is a minimal representation to avoid imposing on the user.
Having these types saves time when using the app with graphql.

An example would look something like:

from graphene import ObjectType, String


class CountryType(ObjectType):

    name = String(description="Country name.")
    name_ascii = String(description="Country name ascii.")
    slug = String(description="Country slug.")
    geoname_id = Int(description="Country geoname id.")
    alternate_names = String(description="Country alternate names.")
    code2 = String(description="Country code 2 letters.")
    code3 = String(description="Country code 3 letters.")
    continent = String(description="Country continent.")
    tld = String(description="Country top level domain.")
    phone = String(description="Country phone code.")
@marianoeramirez
Copy link
Collaborator

It would be great if you can provide some feedback here or test in your projects.

#281

@gdvalderrama
Copy link
Author

It would be great if you can provide some feedback here or test in your projects.

#281

The types look good, but the tests added are failing:

relation "cities_light_country" does not exist

@marianoeramirez
Copy link
Collaborator

Released on V3.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants