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.

useSubscription throwing error 400 bad request in react native

See original GitHub issue

I am working on a project that has a web portal and a react native application. at some stage, I need to get subscription data via useSubscription hook. I used apollo client docs to configure the web socket with Graphql-Ws, that works fine in react web portal but when it comes to react-native it throws blind 400 bad request and it is hard to debug the actual network call. my package.json looks like this: "dependencies": { "@apollo/client": "^3.6.8", "@apollo/react-hooks": "^4.0.0", "@freakycoder/react-native-bounceable": "^0.2.5", "@freakycoder/react-native-custom-text": "0.1.2", "@freakycoder/react-native-helpers": "^1.0.2", "@react-native-async-storage/async-storage": "^1.17.6", "@react-native-community/clipboard": "^1.5.1", "@react-native-community/masked-view": "^0.1.11", "@react-native-picker/picker": "^2.4.1", "@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/native": "^6.0.6", "@react-navigation/stack": "^6.0.11", "@twotalltotems/react-native-otp-input": "1.3.7", "@types/graphql": "^14.5.0", "apollo": "^2.33.9", "apollo-link": "^1.2.14", "apollo-link-error": "^1.1.13", "apollo3-cache-persist": "^0.14.0", "axios": "^0.24.0", "events": "^3.3.0", "formik": "^2.2.9", "graphql": "^16.5.0", "graphql-ws": "^5.9.0", "jwt-decode": "^3.1.2", "moment": "^2.29.3", "react": "17.0.2", "react-native": "0.66.4", "react-native-animatable": "^1.3.3", "react-native-auth0": "^2.13.1", "react-native-calendars": "^1.1284.0", "react-native-document-picker": "^8.1.0", "react-native-dropdown-picker": "^5.4.2", "react-native-dynamic-vector-icons": "^1.1.6", "react-native-file-viewer": "^2.1.5", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.1.1", "react-native-localization": "^2.1.7", "react-native-paper": "^4.12.1", "react-native-paper-dropdown": "^1.0.7", "react-native-phone-number-input": "^2.1.0", "react-native-reanimated": "^2.3.1", "react-native-rename": "^2.9.0", "react-native-safe-area-context": "^3.3.2", "react-native-screens": "^3.10.1", "react-native-splash-screen": "^3.3.0", "react-native-svg": "^12.3.0", "react-native-svg-transformer": "^1.0.0", "react-native-vector-icons": "^9.1.0", "react-navigation-helpers": "^2.0.0", "rn-fetch-blob": "^0.12.0", "yup": "^0.32.11"

**Error:** 

image

note!!! backend is hasura

@bruce @probablycorey @rgrove @ivank let me know if any other info is needed 

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
FaisalSeraj-techverxcommented, Jun 21, 2022

@jpvajda Thanks, Really appreciate the way you handle things

1reaction
jpvajdacommented, Jun 21, 2022

@FaisalSeraj-techverx totally understand! As a note, we plan to increase our response time in this repo as Apollo grow’s the OSS team that supports Apollo Client, so in the near future I hope you will see a quicker overall response to questions and issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not get data with error 400 bad request - Stack Overflow
useParams will be returning object. So you have to modify the first line in your code as const { id } = useParams();....
Read more >
Subscriptions - Apollo GraphQL Docs
Like useQuery , useSubscription returns an object from Apollo Client that contains loading , error , and data properties you can use to...
Read more >
Apollo useQuery React hook Error Handling - Hasura
We will handle the GraphQL loading and error states in React app using the Apollo useQuery React hook properties - loading and error....
Read more >
error bad request axios | The AI Search Engine You Control
Hi, I'm getting 400 when I try to hit my api. The api is working fine. I have validate the API's via postman...
Read more >
react-native | Yarn - Package Manager
React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access...
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