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

feat: continue working on indexer's absence #2248

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

rompemoldes
Copy link
Contributor

@rompemoldes rompemoldes commented Dec 17, 2024

Stop the app from crashing due to Error Responses from the Indexer.

It also improves the handling of the environment variable stored on indexer.graphqlEndpoint.
Now 'none' is case insensitive.

Copy link
Contributor

@arty-name arty-name left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nicer flow could have been:

  const response = await got.post(indexer.graphqlEndpoint, { throwOnHttpErrors: false, json: { query } });
  if (!response.ok) { /* handle error */ }
  const { data } = await response.json<FetchedData<ExpectedQueryResults>>();

@rompemoldes
Copy link
Contributor Author

rompemoldes commented Jan 6, 2025

I tried setting throwHttpErrors: false on the options of the got.post requests and it still throws for me.

You can check out my tries on the cTypeHub repository.

This version is working. Let's use it!

@rompemoldes rompemoldes merged commit 27b856b into main Jan 6, 2025
1 check passed
@rompemoldes rompemoldes deleted the xw/work_on_indexers_absence branch January 6, 2025 20:16
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.

2 participants