I just try to use data from wordpress site to mobile app with graphql from wordpress side I reach to the uri of site “http://10.0.2.2:10005/graphql” after install graphql plugin from app side I did these steps in app.js
import ApolloClient from 'apollo-boost';
import { ApolloProvider } from 'react-apollo';
const client = new ApolloClient({
uri:'http://10.0.2.2:10005/graphql/'
})
export default function App() {
return (
<ApolloProvider client={client}>
<Drawer/>
</ApolloProvider>
);
}
in another screen
import { Query } from 'react-apollo';
import gql from 'graphql-tag';
export default function IndiviOffers() {
return(
<Query query={gql`
{
posts {
edges {
node {
id
}
}
}
}
`}>
{({ loading, error, data })=>{
console.log(data)
return (
<View >
<Text>Your Offers</Text>
</View>
)
}}
</Query>
)
}
got that error Network error: JSON Parse error: Unrecognized token ‘<’
