Skip to content

A way to add descriptions to arguments #334

Closed
@peitalin

Description

@peitalin

Is your feature request related to a problem? Please describe.
Is there a way to add descriptions for arguments?

Describe the solution you'd like
A way to add descriptions to arguments, something like this in the graphql_object! macro:

    field items(
        &executor,
        #[graphql(description = "first n items")]
        first: i32,
        #[graphql(description = "last n items")]
        last: i32,
    ) -> FieldResult<Items> {
        ...
    }

Or:

#[derive(GraphQLInputObject)]
#[graphql(description = "first n items")]
type First = i32;

Which is used in the resolver as:

field item(&executor, first: First, last: Last) -> FieldResult<Item> {
    ...
}

Describe alternatives you've considered
I have looked into #[derive(GraphQLInputObject)] but that seems only for passing structs as arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement of existing features or bugfix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions