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

Desciptions from the schema should be included in the generated code if they exist #164

Closed
dpalmmna opened this issue Nov 22, 2022 · 2 comments

Comments

@dpalmmna
Copy link
Contributor

With the following schema definition defined using graphql syntax:

type query_root {
  """
  fetch data from the table: "maps.acq"
  """
  mapsAcq(
    """distinct select on columns"""
    distinctOn: [MapsAcqrSelectColumn!]

    """limit the number of rows returned"""
    limit: Int

    """skip the first n rows. Use only with order_by"""
    offset: Int

    """sort the rows by one or more columns"""
    orderBy: [MapsAcqOrderBy!]

    """filter the rows returned"""
    where: MapsAcqBoolExp
  ): [MapsAcq!]!
}

In the generated classes the comments could be included to describe the different fields correctly instead of using "Parameter for the mapsAcqr field of query_root, as defined in the GraphQL schema" description string.

All comments are loaded in Description field and no longer in comment (graphql.language.Comment) fields when using java schema parser (graphql/graphql-js#927 and graphql/graphql-spec#420).

Update of all call to setComments in DocumentParser to load Descriptions instead of comments. Allow descriptions to be acessible in template files. Add desciptions to InputParameters if exist to be acessible to templaters.

@etienne-sf
Copy link
Collaborator

Yes, that is a good point.

It would make comment much more effective. I'll check that, hopefully for the next release.

Etienne

@etienne-sf
Copy link
Collaborator

Released in the 1.18.9.

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

No branches or pull requests

2 participants