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

ForceGenerate parameter to @goModel added. #2780

Merged

Conversation

atzedus
Copy link
Contributor

@atzedus atzedus commented Sep 5, 2023

When using autobind directive in configuration, there is no chance to force gqlgen to generate a model if that name matched with model from the autobind package. One solution is rename the type name in graphql schema, but it is not an ideal way.
This PR solves this problem. For example if your package is defined in configuration like:

autobind:
  - myproject/entity

And it have type, for example: Person.

type Person {
  name: String
}

then it will autobind to myproject/entity.Person

If you need to exclude this model from autobind, you can define it like:

type Person @goModel(forceGenerate: true) {
  name: String
}

I have:

  • Updated any relevant documentation (see docs)

@StevenACoffman StevenACoffman merged commit fa47118 into 99designs:master Sep 8, 2023
@atzedus atzedus deleted the ability_to_force_model_generation branch September 8, 2023 14:26
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

Successfully merging this pull request may close these issues.

2 participants