Definition support for operation fields
See original GitHub issueWhen writing a query, you should be able to go-to definition on individual fields, but that is not working.
Here is a demo repo with reproducible config.
No definition found for
[field name]
Given this graphql.config.js
module.exports = {
schema: "./build/schema.graphql",
};
And this build/schema.graphql
type Query {
items: [Item]!
}
type Item {
fieldOne: String!
fieldTwo: String!
}
When writing this query, I’d expect go-to definition on items
to take me to line 2 of the schema or go-to definition on fieldOne
or fieldTwo
to take me to line 6 or 7, respectively, of the schema.
query MyQuery {
items {
fieldOne
fieldTwo
}
}
As far as I can tell, the graphql config is correct, which is demonstrated by the fact that code completion and validation is happening.
See this demo below, where you can see code completion working, but go-to definition failing.
https://user-images.githubusercontent.com/3206804/171949633-9b2d0a07-f7fe-419b-8613-006e17fd1c1c.mov
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top GitHub Comments
This should be available in the last few vscode-graphql releases now, thanks to @stonexer . Thanks everyone for reporting this!
It looks interesting, I’d like to give a try