GraphQLSP icon indicating copy to clipboard operation
GraphQLSP copied to clipboard

fix(graphqlsp): Bail out of `unrollFragment` infinite loop

Open kitten opened this issue 7 months ago • 1 comments

NOTE: This is opened as a draft, since it's not a proper fix, but just demonstrates the issue.

Optimally, a proper fix should either:

  • handle this in every call to getDefinitionAtPosition diagnostics,
  • or; replace getDefinitionAtPosition in places where an alternate solution is more reliable

In specific places we should have diagnostics for these cases, since they're usually user errors (or critical errors we can't recover from).

For example, in the changed section in unrollFragment, we should tell the user that the fragment import is unresolveable. There's also sections for whether a fragment is actually a GraphQL fragment call. If not, we should maybe consider adding a diagnostic to that before bailing out too.

kitten avatar Jul 30 '24 12:07 kitten