-
Notifications
You must be signed in to change notification settings - Fork 57
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
Uniform ID Type for pages and page Queries #350
Conversation
9743490
to
28050ed
Compare
bb34d17
to
4b259f9
Compare
@estyxx the pre-commit failure is from the recent ruff update. can you update |
~~ Mmm it's already commented with #noqa S105 on my branch 🤔 ~~ |
Forgive me if this is an ignorant question, but why should we use |
The benefit of using Now, this PR only changes it for pages, so if we commit, we should go all the way. The reason I haven't merged this yet is that I am still deciding as it is a potentially breaking change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@estyxx having "slept on it", it is a worthy change.
Any chance you could rebase?
87f2a58
to
0b72e6e
Compare
@zerolab I rebased this PR :) |
Currently, in the Wagtail GraphQL API of wagtail-grapple, there is an inconsistency in the input types for the
pages
andpage
queries. While thepages
query expects anID
as an input, thepage
query expects anInt
. This has been leading to unnecessary conversion between string and integer.Proposed Changes
I propose to make the input types consistent by changing the
id
in thepage
query to be of typeID
(the same as in thepages
query).The change can be made in the following file:
grapple/types/pages.py#L336
By changing the return type to
graphene.ID
, it ensures uniformity across the queries and eradicates the need for conversions between string and integer.I updated the documentation as well.