let query = gql`{ viewer { id displayName } }`;
gqlFetch(query).then(data => sayHi(data.viewer));
function sayHi(viewer) {
alert(`Hello, ${ viewer.displayName }`);
}
IDEA will report a warning "Unresolved variable displayName". It would be (increasingly) super cool if
a) the warning didn't happen
b) I could Go To Declaration (ctrl-B, ctrl-click) on the displayName and be taken to the query
c) when there are multiple declarations of the same identifier (id is the worst obvious case), it would take some context into account and rank the more appropriate declarations higher. For example, viewer.id would put the declaration from the example above first, while client.id would prefer some other query that contains client { id }.
Or should that already happen and my IDE is misconfigured somehow? Kinda surprised that I can't find an existing issue about this.
The warning is fairly annoying in my project, as there are hundreds of plain old data fields that only come from queries, never appearing in any code that would cause the warning to shut up.
Say I have a query and a function like this:
IDEA will report a warning "Unresolved variable displayName". It would be (increasingly) super cool if a) the warning didn't happen b) I could Go To Declaration (ctrl-B, ctrl-click) on the displayName and be taken to the query c) when there are multiple declarations of the same identifier (
id
is the worst obvious case), it would take some context into account and rank the more appropriate declarations higher. For example,viewer.id
would put the declaration from the example above first, whileclient.id
would prefer some other query that containsclient { id }
.Or should that already happen and my IDE is misconfigured somehow? Kinda surprised that I can't find an existing issue about this.
The warning is fairly annoying in my project, as there are hundreds of plain old data fields that only come from queries, never appearing in any code that would cause the warning to shut up.