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.

regressions in variable validation

See original GitHub issue

Hey there,

First off, thanks for making Graphiql! It’s great!

I am getting an error similar to the one described in this issue: https://github.com/graphql/graphiql/issues/1308

Here’s the query I have in the inspector:

{
  sequences{
    pageSize
    pageNumber
    results {
      size
      sequenceFeatures {
        start
        end
        name
      }
    }
  }
}

{
  seq
}

And here are the errors:

image

image

I believe this is because the logic passing the highlightNode into the getLocation function is faulty:

      const highlightNode =
      node.kind !== 'Variable' && 'name' in node
        ? node.name
        : 'variable' in node
        ? node.variable
        : node;

image

As you can see in the above image, node.name is undefined yet 'name' in node still === true. This causes undefined to be passed to getLocation on line 137: const highlightLoc = getLocation(highlightNode);

In the past that code used to look like:

  return error.nodes.map(node => {
    const highlightNode =
      node.kind !== 'Variable' && node.name
        ? node.name
        : node.variable
        ? node.variable
        : node;

But got converted in this PR https://github.com/graphql/graphiql/pull/957 to look like:

image

I am going to make a PR to fix this specific issue where the xxx in xxx syntax is being used incorrectly. I think it someone on the graphiql team should look at all the places that got changed to use the xxx in xxx syntax that might now break.

Thanks!

P.S. In case it wasn’t clearn, once I made the change I described above locally, the error I was seeing went away and graphiql resumed working properly again

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
acaocommented, Jun 2, 2020

every release is cut from master branch

try out the alphas? https://www.npmjs.com/package/graphiql

easiest way to get at the last pre-release is npm install graphiql@next or yarn add graphiql@next

1reaction
tnrichcommented, Jun 2, 2020

@acao could you advise on what version I should use to get around this error in the meantime? I believe v0.17.5 is the highest non-beta version but it doesn’t have the code that’s on master. I couldn’t tell which branch 0.17.5 is cut from? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to validate a regression model? - Deepchecks
How to validate a regression model? · Linear Regression Model is used to show the connection between variables that are equal to each...
Read more >
Validating the linear regression model | by Aayushmaan Jain
This test checks for the polynomial dependence of the target variable on the explanatory variables. We can regress the model as.
Read more >
10.6 - Cross-validation | STAT 501
Ideally, we can obtain new independent data with which to validate our model. For example, we could refit the model to the new...
Read more >
Cross-validation pitfalls when selecting and assessing ...
Background. We address the problem of selecting and assessing classification and regression models using cross-validation.
Read more >
Assumptions Of Linear Regression – How to Validate and Fix
To fix non-linearity, one can either do log transformation of the Independent variable, log(X) or other non-linear transformations like √X or X ...
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