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.

GraphiQL `onEditQuery` is called without query argument after TypeScript migration

See original GitHub issue

I’m updating our installation of graphiql to 1.0.0-alpha.1, and thanks to the new TypeScript types (🎉) I was was really quickly made aware that the type signature of the function passed to GraphiQL as the onEditQuery prop has changed:

image

This breaks our usage of graphiql-explorer. (see example setup which uses onEditQuery https://github.com/OneGraph/graphiql-explorer-example/blob/master/src/App.js#L189)

It looks like this change was made in the recent TypeScript migration.

I understand that this prop is likely going to be deprecated in the new API per #1165, but it looks to me like this change was unintentional (onEditQuery is unchanged in the README, and per https://github.com/graphql/graphiql/pull/1242#issue-364380842 that this should have minimal production changes).

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
acaocommented, Apr 1, 2020

great! thanks for this, we can get another alpha out here shortly. I’ll close this once it’s been released. glad the new typescript types are working out for you 😄

0reactions
acaocommented, Apr 12, 2020

use latest alpha btw! @cshaver lemme know if you have any issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating to Apollo Server 4 - Apollo GraphQL Docs
Apollo Server 3 provides the formatResponse hook as a top-level constructor argument. The formatResponse hook is called after an operation successfully gets to ......
Read more >
Queries and Mutations - GraphQL
On this page, you'll learn in detail about how to query a GraphQL server. ... The field name returns a String type, in...
Read more >
Compose a query in GraphiQL · Cloudflare Analytics docs
Click on the editing pane of GraphiQL and add this base query, ... including required parameters, click the dataset name (blue text).
Read more >
typescript-react-query - GraphQL Code Generator
Without loading your GraphQL operations ( query , mutation ... This plugin generates React-Query Hooks with TypeScript typings.
Read more >
Gatsby error: Unexpected type: Query, while running ...
To temporarely work around some graphQL querying that are no longer ... type SitePageContext { name: String lang: String sitemapPriority: ...
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