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

Is it possible to turn the token field names configurable by settings? #294

Open
feslima opened this issue Jan 31, 2022 · 0 comments
Open

Comments

@feslima
Copy link

feslima commented Jan 31, 2022

Hi, thank you for the project and work!

I mean, for example, when obtaining the token pairs, we perform the mutation like this:

mutation TokenAuth($username: String!, $password: String!) {
  tokenAuth(username: $username, password: $password) {
    token
    refreshToken
    payload
    refreshExpiresIn
  }
}

Suppose I want to rename the field token to access and refreshToken to refresh and perform the mutation like this:

mutation TokenAuth($username: String!, $password: String!) {
  tokenAuth(username: $username, password: $password) {
    access
    refresh
    payload
    refreshExpiresIn
  }
}

I saw that the name definitions are done here:

cls._meta.fields["token"] = graphene.Field(graphene.String, required=True)

and here:
cls._meta.fields["refresh_token"] = graphene.Field(

Is it possible to make these fields configurable via settings definition or is it a breaking change?

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

1 participant