Feature: Go to definition support for union
Wonderful work team! This really helps during the development process! Thanks a lot.
Currently, go-to definition support is not there. It would be great if we can support the go-to definition for a union.
Hey and thanks @ba-nitesh 👋 in our test schema I can successfully
- Cmd-click a field that returns a union
- Click the union type in the mouseover tooltip
- Cmd-Click a union member type in an inline fragment
Can you specify which case exactly is not working for you? Can you also tell us which GraphiQL version you are seeing this issue in?
https://user-images.githubusercontent.com/22288634/179691052-4a75400e-20c3-409e-ad57-57551c3fbcca.mp4
To clarify this repository getting used by vs-code extension GraphQl right?
In the description mentioned that go to definition supports for input, enum, type only. (go to definition support (input, enum, type))
Sorry, I implicitly assumed this is about GraphiQL 😅 🙈 I'm not that familiar with the VSCode extension, pinging @acao here
No worry, Thanks for your response. Let me know if I can help you guys.
@ba-nitesh thank you
Currently we only support these cases for definition lookup, however that file is where one would want to start to add this behavior!
And can I ask, are you referring to jumping to a union from a query?
# example.graphql
union MySearchUnion = Document | Media
# anotherfile.graphql
type Query {
search: MySearchUnion # < this should jump to example.graphql on cmd/ctrl + click
}
correct?
Right, your example is completely conveying what I am trying to say. Thanks!
fabulous! we can add that
You are great! When are we planning to add this and how long would it take to release the vs-code extension update?
@ba-nitesh sorry I cannot say, I've been quite busy with work!
https://github.com/graphql/graphiql/pull/3150
I believe this PR should resolve it! Raised the PR before realising there was an issue for it already.
That being said, pretty new to this codebase, so might be missing something with the approach!