Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: new util to manage historyStore outside of query history component #1914

Merged
merged 2 commits into from Jul 10, 2021

Conversation

harshithpabbati
Copy link
Contributor

fixes: #1892

Since the history store is inside the query history panel, it's not getting updated until we open the panel, so instead, I created a new historyStore util to manage the store.

@changeset-bot
Copy link

changeset-bot bot commented Jun 27, 2021

🦋 Changeset detected

Latest commit: 1a362e6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
graphiql Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@harshithpabbati harshithpabbati force-pushed the query-history branch 2 times, most recently from 45bfb06 to 7419c58 Compare June 27, 2021 05:18
@codecov
Copy link

codecov bot commented Jun 27, 2021

Codecov Report

Merging #1914 (1a362e6) into main (2d91916) will increase coverage by 0.13%.
The diff coverage is 65.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1914      +/-   ##
==========================================
+ Coverage   65.70%   65.84%   +0.13%     
==========================================
  Files          85       86       +1     
  Lines        5106     5135      +29     
  Branches     1631     1638       +7     
==========================================
+ Hits         3355     3381      +26     
- Misses       1747     1750       +3     
  Partials        4        4              
Impacted Files Coverage Δ
...ackages/graphiql-toolkit/src/create-fetcher/lib.ts 50.90% <20.00%> (-8.67%) ⬇️
packages/graphiql/src/utility/HistoryStore.ts 62.26% <62.26%> (ø)
packages/graphiql/src/components/QueryHistory.tsx 73.91% <76.47%> (+6.69%) ⬆️
...iql/src/components/DocExplorer/MarkdownContent.tsx 100.00% <100.00%> (ø)
packages/graphiql/src/components/GraphiQL.tsx 58.34% <100.00%> (+0.83%) ⬆️
...hql-language-service-server/src/findGraphQLTags.ts 64.89% <100.00%> (+4.25%) ⬆️
packages/graphiql/src/utility/QueryStore.ts 42.85% <0.00%> (+2.04%) ⬆️
packages/graphiql/src/components/ToolbarButton.tsx 92.85% <0.00%> (+21.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04fad79...1a362e6. Read the comment docs.

@harshithpabbati
Copy link
Contributor Author

According to the discussion in #1782

Created a new prop, which will allow passing in maxHistoryLength. To default, it is set to 20.

@acao
Copy link
Member

acao commented Jul 9, 2021

awesome, thank you @harshithpabbati !

@acao
Copy link
Member

acao commented Jul 9, 2021

@harshithpabbati I think this means we have several unused files to delete in packages/graphiql/src/utils now, can you remove the unused files?

@harshithpabbati
Copy link
Contributor Author

@harshithpabbati I think this means we have several unused files to delete in packages/graphiql/src/utils now, can you remove the unused files?

I don't think there are any unused files.

@acao
Copy link
Member

acao commented Jul 10, 2021

@harshithpabbati I see now, after a closer reading, thank you!

@acao acao changed the title fix: create a new util to manage historyStore out of query history component fix: new util to manage historyStore outside of query history component Jul 10, 2021
@acao acao merged commit eb2d91f into graphql:main Jul 10, 2021
@github-actions github-actions bot mentioned this pull request Jul 10, 2021
eldargab added a commit to subsquid/graphiql-console that referenced this pull request Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

History is not saving when history pane is closed.
2 participants