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

Possibility to rename pk to id or something else #121

Closed
ryou90 opened this issue Jun 3, 2022 · 2 comments · Fixed by #446
Closed

Possibility to rename pk to id or something else #121

ryou90 opened this issue Jun 3, 2022 · 2 comments · Fixed by #446

Comments

@ryou90
Copy link

ryou90 commented Jun 3, 2022

Currently, when a filter is created for a single object, "pk" is used as the ID name. There is no possibility to specify an alternative name.

Feature Request Type

  • Change (enhancement/optimization) of an existing feature.

Description

Ability to set custom name for "pk".

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@patrick91
Copy link
Member

an example of this:

@strawberry.type
class Query:
  foo = strawberry.django.field()

I wonder how we can customise the name of the argument, we could that on the type, or on the field. I'm not sure what the best option is

@bellini666
Copy link
Member

@patrick91 maybe something similar to what I did on CUD mutations? Add a field to define the argument name to be used in this case, which users can customer on a per-field settings, and also a django setting to define the global default one, defaulting to pk.

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