-
Notifications
You must be signed in to change notification settings - Fork 42
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
How to change names of queries and mutations ? #196
Comments
Hi @maszuDEV , the names of the default operations will use the class and namespace, check these links for reference:
I think a work around for your case could be to add
Remember that |
@00dav00 This is what I needed! Works great, thanks a lot! |
Good to know @maszuDEV ! |
We should probably add a simpler way to rename queries... Another way to do this if you are using the plugin to mount this gem in your own schema, would be to create your own login mutation that inherits from the one included in this gem, and use it in you own mutation type with the name you like. Like we do in here:
then, in your mutationType file you would just do: field :user_login, mutation: Mutations::Login, authenticate: false |
@00dav00 reopening this one as a feature request. Changing names of the queries should be straightforward and a nice addition. Perhaps something in the resource loaders like: GraphqlDevise::ResourceLoader.new(User, only: [:login, :confirm_registration_with_token], custom_names: { login: :my_user_login_custom_mutation }) WDYT? |
Question
Hello everyone,
In my case, I have a user model like:
User::Model
, which is generating mutations named, e.g.userModelLogin
.Is there any option to change the way how queries and mutations are naming? I would like to have just
userLogin
.Best regards!
The text was updated successfully, but these errors were encountered: