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

TILA-776 | Resource mutations and query changes #272

Merged
merged 6 commits into from
Sep 17, 2021
Merged

Conversation

nicobav
Copy link
Contributor

@nicobav nicobav commented Sep 16, 2021

No description provided.

is_draft describes whether the resource is still being edited and should
not be displayed to end users

TILA-776


class ResourceCreateSerializer(ResourceSerializer, PrimaryKeySerializer):
location_type = serializers.CharField(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ChoiceField, might get better validation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got some weird error if this was ChoiceField (or was not redefined at all): AssertionError: Found different types with the same name in the schema: location_type, location_type.

But your comment in mind => have to write validation check for location type

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it might be a bug with having type in field name 😮

graphql-python/graphene-django#185 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this with changing the model name (migrations and all) to not contain type but it still nagged about it. It could be something related with ChoiceField go and tell 🤷
Anyhow I added the validations for the infamous location_type

@nicobav nicobav merged commit c08ca9f into main Sep 17, 2021
@nicobav nicobav deleted the TILA-776/resource-gql branch September 17, 2021 06:26
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

Successfully merging this pull request may close these issues.

2 participants