Is it possible to host an Apollo/GraphQL server & client within an expo/go app?

Please provide the following:

  1. SDK Version: 47
  2. Platforms(Android/iOS/web/all): all

So I am currently working on an application with an offline/local database.
To communicate with the DB I want to use GraphQL for querying and have already set up a basic Apollo server using Node on localhost (my pc).

At the moment I am wondering if it is possible to have my expo app run a frontend and “local” instance of the GraphQL server & database. At the moment all information I can find online are detailing how to run a GraphQL/Apollo client using expo that communicates to a remote server.

Hi @jahb

Searching for that seems hard.

If you can find a solution for plain React Native apps, then it should work in Expo. You might need to write a config plugin.

If the server is written in pure JavaScript/TypeScript without using nodejs-specific libraries, yes, but this seems very unlikely.

If you can find a way to do it in a native Android app and a native iOS app, you should be able to do it in an Expo app, but would need to write a native module, e.g. using the Expo Modules API

But it seems like you might have more luck posting a question like “How can I query a local database in a React Native app using a GraphQL client?” to a place like Stack Overflow.

Hey! Thanks for the help in the end I believed rather than hosting a server and a client within the application using just the client with Apollos offline resolvers methods may be a smarter move.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.