You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project, I have a folder full of .gql files that are inputs to the code generator. For example:
# gql/user.gqlqueryGetUser {
user {
idname
}
}
Using the typescript-react-apollo plugin, this will generate a hook called useGetUserQuery():
// screens/MyScreen.tsximport{useGetUserQuery}from"../graphql.ts"// <- This is the codegen output fileconstMyScreen=()=>{const{ data }=useGetUserQuery();
...
}
My question: Is there any way (maybe an extension or something) to easily navigate from the generated hook back to the original query? I'm imagining like the "Go To Definition" action when I click on the hook, but it instead takes me back to the gql/user.gql file.
I don't think this is currently possible, but I just wanted to check before I jump into the rabbit hole of making my own extension.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In my project, I have a folder full of
.gql
files that are inputs to the code generator. For example:Using the
typescript-react-apollo
plugin, this will generate a hook calleduseGetUserQuery()
:My question: Is there any way (maybe an extension or something) to easily navigate from the generated hook back to the original query? I'm imagining like the "Go To Definition" action when I click on the hook, but it instead takes me back to the
gql/user.gql
file.I don't think this is currently possible, but I just wanted to check before I jump into the rabbit hole of making my own extension.
Beta Was this translation helpful? Give feedback.
All reactions