Error 400 no generic error
See original GitHub issueOverview
- **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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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).
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.