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.

Error 400 no generic error

See original GitHub issue

Overview

  • **Client ID:**jyHeS_MVualewtI_Ab4wHg
  • Issue type: question, bug
  • Summary: (A few sentences describing the issue and what you’re trying to do)
  • Platform: react native/apollo client

Description

Trying to do a business search, but get’s error 400 instead with no reason why.

Endpoint

Fusion Search API

Parameters or Sample Request

this.client = new ApolloClient({
	uri: 'https://api.yelp.com/v3/graphql',
	request: (operation) => {
		operation.setContext({
			headers: {
				Authorization: `Bearer ${API_KEY}`,
				"Content-Type": 'application/graphql',
			}
		})
	},
	cache: new InMemoryCache(),
});

Response

[Network error]: Error: Response not successful: Received status code 400

Extra information

Error information from remote js debugger (react native)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
teekwakcommented, Apr 20, 2018

Query looks good to me. Just tested myself as well via command-line.

I see that you are using React-Native. Correct me if I am wrong, but your code snippet seems to be creating the ApolloClient in a React component. If so, this will cause a CORS error when the ApolloClient makes the fetch request, which we do not currently support (see https://github.com/Yelp/yelp-fusion/issues/64 for workarounds to this issue).

0reactions
mrjackyliangcommented, May 28, 2018

I found that the request isn’t being created inside a React component.

The component calls the function which the function loads the class via an instance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the 400 Bad Request Error - Lifewire
The 400 Bad Request error means that the request you sent to the website server to view the page was somehow incorrect.
Read more >
What is a Bad Request Error 400 and How Do You Fix It?
The server might classify it as a client-side generic error due to invalid request message framing, or even malformed request syntax. Another possible...
Read more >
What is HTTP error 400 and how do you fix it? - IT PRO
This error can indicate that a request has not been met successfully, or that the remote server that received the request was unable...
Read more >
HTTP error 400: how to fix it? - Debug Bar
Error in the syntax of the URL. A badly typed URL or a bad syntax can cause a 400 bad request error. ·...
Read more >
400 Bad Request - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request ......
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