You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
# Contentstack GraphQL with the Apollo Client React-Native
3
+
# Build an example app using Contentstack React Native SDK, GraphQL API, and Apollo Client
4
+
We have created a sample product catalog app that is built using Contentstack’s iOS SDK. The content of this app is powered by Contentstack GraphQL APIs, and the app uses Apollo client on the client side to consume GraphQL APIs.
4
5
5
-
Apollo Client provides the best way to use GraphQL to build client applications as you can use it to quickly build a UI that fetches data with GraphQL, and you can use any JavaScript front-end.
6
-
7
-
Using Apollo Boost you can easily configure Apollo Client with the recommended settings in your app. Apollo Boost includes packages that are essential for building an Apollo app.
6
+
This document covers the steps to get this app up and running for you. Try out the app and play with it, before building bigger and better applications.
@@ -23,19 +21,19 @@ Log in to your Contentstack account and [create a new stack](https://www.content
23
21
24
22
## Step 2: Add a publishing environment
25
23
26
-
[Add a publishing environment](https://www.contentstack.com/docs/guide/environments#add-an-environment) to publish your content in Contentstack. Provide the necessary details as per your requirement. Read more about [environments](https://www.contentstack.com/docs/guidtens).
24
+
[Add a publishing environment](https://www.contentstack.com/docs/guide/environments#add-an-environment) to publish your content in Contentstack. Provide the necessary details as per your requirement. Read more about [environments](https://www.contentstack.com/docs/guide/environments).
27
25
28
26
## Step 3: Import content types
29
27
For this app, we need one content type: Product Here’s what it is needed for:
30
28
-**Product**: Lets you add the product content into your app
31
29
32
-
For quick integration, we have already created the content type. [Download the content types](https://github.com/contentstack/contentstack-reactnative-graphql-example/raw/master/ContentTypes.zip) and [import](https://www.contentstack.com/docs/guide/content-types#importing-a-content-type) it to your stack. (If needed, you can [create your own content types](https:/cs/guide/content-types#rting-a-content-type). Read more about [Content Types](https://www.contentstack.com/docs/guide/content-types)
30
+
For quick integration, we have already created the content type. [Download the content types](https://github.com/contentstack/contentstack-reactnative-graphql-example/raw/master/ContentTypes.zip) and [import](https://www.contentstack.com/docs/guide/content-types#importing-a-content-type) it to your stack. (If needed, you can [create your own content types](https://www.contentstack.com/docs/guide/content-types#creating-a-content-type). Read more about [Content Types](https://www.contentstack.com/docs/guide/content-types)
33
31
34
-
Now that all the content types arecredy, let’s add some content for your Product app.
32
+
Now that all the content types are ready, let’s add some content for your Product app.
35
33
36
34
## Step 4: Add content
37
35
38
-
[Create](https://www.contentstack.com/docs/guide/content-management#add-a-new-entry) and [publish](https://www.contentstack.com/docs/guide/content-management#publish-an-entry) entries for thereti-content type.
36
+
[Create](https://www.contentstack.com/docs/guide/content-management#add-a-new-entry) and [publish](https://www.contentstack.com/docs/guide/content-management#publish-an-entry) entries for the 'Product' content type.
39
37
40
38
Now that we have created the sample data, it’s time to use and configure the presentation layer.
Create a file named `apollo.js` and export a funtion that accepts a token and returns an instance of Apollo Client. You have to configure the Apollo client with the GraphQL endpoint and the token. (Replace with your own GraphQL endpoint)
56
+
Create a file named `apollo.js` and export a function that accepts a token and returns an instance of Apollo Client. You have to configure the Apollo client with the GraphQL endpoint and the token. (Replace with your own GraphQL endpoint)
59
57
```
60
58
import { ApolloClient } from 'apollo-client';
61
59
import { HttpLink } from 'apollo-link-http';
62
60
import { InMemoryCache } from 'apollo-cache-inmemory';
0 commit comments