https://kotlinlang.org logo
#graphql-kotlin
Title
# graphql-kotlin
g

Goregius

12/28/2019, 6:21 PM
Are there any plans to use string literals for descriptions instead of comment descriptions since comment descriptions don't get picked up by Apollo Gateway by default?
d

Dariusz Kuc

12/28/2019, 8:00 PM
we are using Apollo Gateway and comments seems to be working fine?
afaik single line comments can be made as
# your comment
multi line comments should be done in
""" block """
we probably should add support for multi line comments
At the same time we are just using graphql java underneath it (atm)
So it should technically just works
g

Goregius

12/28/2019, 8:41 PM
Maybe it's a new update to Apollo that doesn't allow them anymore because I do remember it working before. But even with the latest example spring federated server it's not showing. Could just be my laptop being weird
d

Dariusz Kuc

12/28/2019, 9:22 PM
interesting
wondering whether this is something with federation logic in the gateway
we are currently using stitching in our apollo server and documentation works fine
g

Goregius

12/28/2019, 9:31 PM
Yeah it's just Apollo (not just the gateway) that removes the # descriptions from the schema, I tried this with a normal Apollo server. I'm assuming this is because it treats them as purely comments and not as descriptions.
Copy code
type Product @key(fields: "upc") {
  upc: String!
  #name from hash comment
  name: String
  """price from string literal"""
  price: Int
  weight: Int
}
the name didn't have a description but the price did
Actually I think it's apollo federation, not specifically the gateway, the comments are shown when using a non federated service
I did some digging and found that graphql-java have made this change (found in this commit: https://github.com/graphql-java/graphql-java/commit/0919e71c1d04b982426f651821c6ee52437b5b84) which changes the format of descriptions to the new quote format. This change has been released but not as a major release. And is modifiable with the descriptionsAsHashComments function.
d

Dariusz Kuc

12/28/2019, 10:33 PM
👍 once gql java releases new version we'll upgrade our dependency
Wondering if federated gateway strips out all comments
Regardless whether they start with # or """
This would simplify their stitching logic between federated types
Feel free to raise this as an issue on the graphql kotlin repo so we can keep track of it
g

Goregius

12/29/2019, 12:44 AM
the gateways only strip the # comments, the """ comments stay there, I'm guessing they do this because federation was created after # became depreciated
d

Dariusz Kuc

12/29/2019, 1:20 AM
👍 thanks for raising this
5 Views