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

FormatSchemaDocument and FormatQueryDocument support to print comments #262

Closed
sonatard opened this issue Jun 24, 2023 · 2 comments · Fixed by #263
Closed

FormatSchemaDocument and FormatQueryDocument support to print comments #262

sonatard opened this issue Jun 24, 2023 · 2 comments · Fixed by #263

Comments

@sonatard
Copy link
Contributor

sonatard commented Jun 24, 2023

What happened?

FormatSchemaDocument and FormatQueryDocument doesn't print comments.

  • input GraphQL file
type query {
  # TODO: Fix
  id: ID!
}

FormatSchemaDocument remove comments from GraphQL files.

type query {
  id: ID!
}

What did you expect?

I would like to generate the following GraphQL output by parsing the given GraphQL file.

type query {
  # TODO: Fix
  id: ID!
}

Minimal graphql.schema and models to reproduce

  • schema
type query {
  # TODO: Fix
  id: ID!
}
  • query
query {
  # TODO: Fix
  id
}

versions

  • go list -m github.com/vektah/gqlparser/v2? 2.5.4
  • go version? 1.20

refs

#261

@StevenACoffman
Copy link
Collaborator

@Warashi are you interested in taking this on?

@Warashi
Copy link
Contributor

Warashi commented Jun 24, 2023

I tried this when implementing #261, but could not implement it successfully and only sent the lexer as a PR.
I will try some more with reference to Go's parser and formatter.

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 a pull request may close this issue.

3 participants