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

Strange formatting when using "as_schema_language" #879

Open
mrtnzlml opened this issue Feb 15, 2021 · 2 comments
Open

Strange formatting when using "as_schema_language" #879

mrtnzlml opened this issue Feb 15, 2021 · 2 comments
Labels
blocked bug Something isn't working

Comments

@mrtnzlml
Copy link

Hello! I noticed the following strange formatting (pay attention to the unitAmountCurrency field how it sits behind the comment):

input ProductPriceInput {
  """
    The unit amount in centavo to be charged, represented as a whole integer.
    Centavo equals ¹⁄₁₀₀ of the basic monetary unit.
  """ unitAmount: Int!
  "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html)." unitAmountCurrency: SupportedCurrency!
}

See: https://github.com/adeira/universe/blob/d1e60f44855dd5221c86c818188ba31163ec2342/src/ya-comiste-meta/schema.graphql#L100-L106

There is a similar output object where this is not happening:

type ProductPrice {
  """
    The unit amount in centavo to be charged, represented as a whole integer.
    Centavo equals ¹⁄₁₀₀ of the basic monetary unit.
  """
  unitAmount: Int!
  "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html)."
  unitAmountCurrency: SupportedCurrency!
}

See: https://github.com/adeira/universe/blob/d1e60f44855dd5221c86c818188ba31163ec2342/src/ya-comiste-meta/schema.graphql#L157-L165

The input is defined here: https://github.com/adeira/universe/blob/d1e60f44855dd5221c86c818188ba31163ec2342/src/ya-comiste-rust/server/src/commerce/model/products.rs#L147-L155

Thanks for having a look! 😎

@mrtnzlml
Copy link
Author

I just encountered another case where this is happening (enums with Rust doc comments):

enum ProductMultilingualInputVisibility {
  "Visible in backoffice only (accessible to authorized users)." PRIVATE
  "Visible in eshop only (therefore it's public)." ESHOP
  "Visible in POS only (accessible to authorized users)." POS
  "Visible everywhere (in public eshop, POS and of course backoffice)." EVERYWHERE
}

@LegNeato
Copy link
Member

Interesting. We use https://github.com/graphql-rust/graphql-parser 's AST printing, sounds like a bug there possibly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants