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

Change controller type name #120

Open
LouisMT opened this issue Jul 26, 2023 · 2 comments
Open

Change controller type name #120

LouisMT opened this issue Jul 26, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@LouisMT
Copy link

LouisMT commented Jul 26, 2023

Using the following code:

class SomethingController : GraphController {
  [Mutation]
  public async Task<IGraphActionResult> Create() {
    return Ok(...);
  }
}

The type name of the root mutation something becomes Mutation_Something.

I was wondering if the name of this type can be changed. I couldn't find anything about this in de docs so far.

@kevin-carroll
Copy link
Member

Hey @LouisMT ,

Currently, no, its not possible to influence that name. It's on the roadmap though. There are some nuances to deal with the naming of the intermediate types that get created for longer field templates since the controller doesn't actually make it into the schema.

For example, this creates three object types on your schema, not just one Mutation_Something.

class SomethingController : GraphController 
{
      [Mutation("/field1/field2/field3"]
      public async Task<IGraphActionResult> Create() 
      {
           return Ok(...);
      }
}

But it is a solvable problem. No guarantees yet on when it would make it in, there are some higher priority items I'm trying to finish up for August. But I'll do my best to make it sooner than later.

Cheers,
Kevin

@kevin-carroll kevin-carroll added the enhancement New feature or request label Jul 26, 2023
@kevin-carroll kevin-carroll self-assigned this Jul 26, 2023
@LouisMT
Copy link
Author

LouisMT commented Jul 27, 2023

Thanks!

It's no big deal, I was just wondering if I overlooked it in the docs.

I really like this library so far, keep it up! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants