question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[TypedDocumentNode] No auto complete on variable

See original GitHub issue

Version : Beta 8

Can’t seem to get auto complete to work on variables image

image

Works fine for returned data image

export const UserDocument: DocumentNode<UserQuery, UserQueryVariables> = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"user"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UserWhereUniqueInput"}}},"directives":[]}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"},"arguments":[],"directives":[]},{"kind":"Field","name":{"kind":"Name","value":"id"},"arguments":[],"directives":[]}]}}]}}]};

Thanks for all your great work!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
logaretmcommented, Oct 21, 2020

Don’t think that’s a villus issue. For the first one, I was avoiding this for a while but looks like a major upgrade is in order. The signatures need to be updated so it doesn’t confuse the DocumentNode with QueryComposableOptions.

Basically all useQuery, useMutation and useSubscription signatures will follow this scheme:

  1. first argument is always query
  2. second argument is always variables
  3. third argument is always options where applicable

That or just always an object, no second arguments. This will make the API more scalable

Will tag this as rc.0 once done

0reactions
kingkong404commented, Oct 22, 2020

@logaretm Looks to be working great. Thanks a lot, much appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypedDocumentNode: the next generation of GraphQL and ...
With the support of the client-side libraries, we get automatic type inference and auto-complete - without generating additional code: ...
Read more >
dotansimha/graphql-typed-document-node - GitHub
You'll get automatic type inference, auto-complete and type checking based on your GraphQL operation. Supported Libraries. Most libraries supports DocumentNode ...
Read more >
Spyder does not autocomplete local variables - Stack Overflow
When I'm starting to write a variable name which was already declared, and press TAB (this is the default shortcut), I get nothing....
Read more >
GraphQL + TypeScript === | Livecycle
Autocomplete for Writing Queries · Generating Types Automatically from Gql/Graphql Files · Better type inference using typed-document-node · Data ...
Read more >
How To Generate TypeScript Types From GraphQL - DatoCMS
Keep also in mind that the graphql.config.yml file can be used in the GraphQL extension for Visual Studio Code to get auto-completion and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found