I am new in graphql, would you please help me, I have a server for myself. I want to know may I use express-graphql for the server-side code and get query in a reactnative(mobile app) application through Apllo client?
Yes, there is no problem using React Native as the frontend for your Express server. You can connect your GraphQL either with Apollo or Relay Modern. There are other options for server side, like Koa (http://koajs.com/)
GraphCool is also an easy to go platform to build your server: https://www.graph.cool/
You can find amazing tutorials here: https://www.howtographql.com/
This post is really good to get started too: https://dev-blog.apollodata.com/full-stack-react-graphql-tutorial-582ac8d24e3b
Or you can follow the official docs of Apollo GraphQL: https://www.apollographql.com/docs/react/
Or Learn Apollo docs: https://www.learnapollo.com/tutorial-react/react-01/
Hope it helps.
Related
I have Program in Codeigniter 3 i would like to extend it version in React Native but i couldn't find any hooks or code connect them each other if its possible can anyone show an example with code of login or something to connect them together in an efficient way. please?
Would like to an example program connecting each other(RN and Ci)
You can use codeigniter as an REST API layer. You can use the following package to create REST server with codeigniter.
codeigniter-restserver
And, then use react/ react-native to consume those APIs.
Hope that answers your question.
Thanks
In order to quickly prototype ideas for a personal project I'm interested in a solution where I use Prisma directly from a react native app. (I'm aware this is not something you'd do in production.) Data for the single user app would be stored in some free SQL cloud DB. I would store auth information locally in the client.
Is this possible just like it would be possible in a nodejs Cli or webapp?
Currently Prisma only works on servers so you would need to use it on Node. There's a request for react-native support so you can add upvote the request.
I have seen many people using nextjs with expressjs and without expressjs framwork. Can someone please explain why do we need expressjs with nextjs? Nextjs works as SSR without expressjs. What does expressjs add to nextjs when we use it together? Assuming that we are using different rest api server.
You don't need to use expressjs if all you want is server-side rendering. But if you want to go beyond that by adding an API, as an example, then you need to be able to override the routing and that's when you'd add expressjs in front. Express will get the request and see if it is for the API or if it's just a normal nextjs page. LogRocket has a very good tutorial on this https://blog.logrocket.com/how-to-build-a-server-rendered-react-app-with-next-express-d5a389e7ab2f/
You most likely don't need to override Next's default server. For edge cases where you do, you'll see examples showing a custom server extending Next's default. You can use whatever server framework you want – Express, Hapi, etc.
https://nextjs.org/docs/advanced-features/custom-server
I'm trying to integrate my already created IBM Watson chatbot into my react native mobile application. Any time I import watson-developer-cloud I get an error saying that Node.js standard libraries such as stream are not compatible with Expo. I've seen other people using watson services to create speech to text apps. I don't understand how they are using the services without the watson-developer-cloud package. I've seen some community created packages such as react-native-watson that supposedly can make this happen, but I can't get any of it to work. Is there any way I can make this work or is it impossible? Any suggestions are welcome and appreciated.
Just to help you with some path, for sure you can use React Native to built the UI for your app. But also you need the back-end and communicate with Watson API. (If you want you can use just the fetch from react native, but I really recommend you don't do that if your app will grow with time.
I really recommend you take a look at Watson developer Cloud, and use the Assistant Simple to understand the backend with Node.js. Also try to check the Watson Assistant API documentation.
For summary, you'll create one server with Node.js and express, and create routers in your backend, with theses routes, you gonna use fetch from React native to send HTTP requests to your routes, your backend will call Watson Assistant API and answer. Your fetch will get this response and show that to the user in your U.
Obs.: You can use any language in the backend and Watson Developer Cloud has a lot of examples using Watson Assistant with Java, Python, etc.
See the Official Watson Assistant API documentation.
See the Official use of Fetch in React Native.
I am working on an react native app where I need some local persistence. Realm looks like a good option. I also have Relay/GraphQL for the app. Relay has its own cache manager, but the cache data has to be fetched from the Realm db. Can someone please let me know if there is a transformation tool that can convert the data fetched from Realm db to Relay appropriate content?
Thanks in advance.
There's no existing transformation tool to my knowledge that integrates Realm with Relay.
This project allows you to serve GraphQL from a Realm server: https://github.com/realm/realm-graphql-service