graphiql
graphiql copied to clipboard
Missing field type info in code mirror and type ahead is broken
In doc viewer, the type of edges
([AccessEdge]!
) is shown correctly
But in code mirror, the type is missing
Also, if the type is missing, type ahead inside the field doesn't work. Not sure if they share the same cause
edges {
type_here_no_hint
}
This is an issue with https://github.com/graphql/graphiql/blob/main/packages/graphiql-react/src/editor/completion.ts
It's hard to tell what wrong, because we've lost most of the git history for graphiql
@acao I would like to work on this issue. Any suggestions or starting points?
Hi @yilinjuang 👋 I just tried to replicate this bug with the current state of main
but was not able to. I tried it for the same kind of wrapped type (non-nullable list of nullable underlying types) but the info tooltip showed me the correct type.
![CleanShot 2022-06-27 at 10 53 43@2x](https://user-images.githubusercontent.com/22288634/175900526-2fbc8892-1aa1-4735-897f-162136b0ecd2.png)
As I can't reproduce this, it's even better when you have some time to look into this! 🙌 This file (which is part of codemirror-graphql
) registers the handler that renders the contents of this tooltip. The token
argument of the callback will be the type or field that you hover over. Note that the implementation will change slightly with #2513 (will hopefully be merged in the coming days).
@yilinjuang it could be that our html-escape
is filtering out the string. is your type name spec valid? personally I think it's restrictive, I think there are proposals to extend it.