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.

type lookup in hint fails

See original GitHub issue

Hi,

we’re using the codemirror-graphql in the GraphQL Playground and experience problems, that the type property of a suggestion is undefined. It happens in this line of code: https://github.com/graphql/codemirror-graphql/blob/master/src/hint.js#L66

The problem is, that item.detail can contain ! in the case of a non-nullable type. item.detail comes from here https://github.com/graphql/graphql-language-service/blob/master/packages/interface/src/getAutocompleteSuggestions.js#L97

schema.getType() however is just returning getTypeMap()[name] - as there is no type with the name User!, undefined is returned. https://github.com/graphql/graphql-js/blob/master/src/type/schema.js#L182

Now is the question what the solution for this could be. The quick-fix, that would work for us, is just not calling .getType() in hint anymore. But I guess that the type lookup has been added for a reason.

@asiandrummer would be awesome to hear your take on that.

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
yoshiakiscommented, Jun 16, 2020

unfortunately, i don’t know either. it’s a pain to disable Check JS every time, though 😦

1reaction
acaocommented, Jun 16, 2020

also, thank you @yoshiakis so very much for your stewardship of codemirror-graphql!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can we use a Hint in lookup override sql? - Informatica Network
I want to know if we can use a hint in the lookup override sql. I tried using it but the session would...
Read more >
Python type hint for classes that support __ ... - Stack Overflow
When I run mypy on the above example (which I just added a test case to), it fails BadGetItem objects because of incompatible...
Read more >
Loop over lookup('dict', variable) fails when variable denotes a ...
The loop keyword always requires a list, and it is known that in single item lists that lookup will not return a list....
Read more >
The state of type hints in Python - Bernát Gábor
First, let's see why do we need type hints in Python. ... Another problem is that now the type hint information competes with...
Read more >
PEP 484 – Type Hints - Python Enhancement Proposals
meth_2('a') # This is an error! A type variable used in a method that does not match any of the variables that parameterize...
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