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

entgql: support optional description for mutation inputs #421

Merged
merged 1 commit into from
Dec 30, 2022

Conversation

tankbusta
Copy link
Contributor

@tankbusta tankbusta commented Dec 29, 2022

This enables support for the customization of the comment on mutation inputs auto-generated by ent.

func (TodoItem) Annotations() []schema.Annotation {
    return []schema.Annotation{
        entgql.Mutations(
            entgql.MutationCreate().
                Description("The fields used in the creation of a TodoItem"),
            entgql.MutationUpdate().
                Description("The fields used in the update of a TodoItem"),
        ),
    }
}

Generates:

"""The fields used in the creation of a TodoItem"""
input CreateTodoItem {
	"""fields omitted"""
}
"""The fields used in the update of a TodoItem"""
input UpdateTodoItem {
	"""fields omitted"""
}

@a8m a8m requested a review from giautm December 29, 2022 18:12
Copy link
Collaborator

@giautm giautm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, 💯

Copy link
Member

@a8m a8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@a8m a8m merged commit 7ed77ac into ent:master Dec 30, 2022
@tankbusta tankbusta deleted the feat/add_gqlmutation_description branch December 30, 2022 05:44
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.

3 participants