Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:Network request failed #10

Open
pira998 opened this issue Sep 11, 2021 · 0 comments
Open

Error:Network request failed #10

pira998 opened this issue Sep 11, 2021 · 0 comments

Comments

@pira998
Copy link

pira998 commented Sep 11, 2021

i am trying to use wrangler graphql server
My config file
import Constants from 'expo-constants';

// get the localhost ip address at runtime using the Expo manifest
// this enables both simulator and physical device debugging with our local api
let localhost;
if (Constants.manifest.debuggerHost) {
localhost = Constants.manifest.debuggerHost.split(':').shift();
}

// set environment variables
const ENV = {
dev: {
API_URI: http://127.0.0.1:8787/
},
prod: {
// update the API_URI value with your publicly deployed API address
API_URI: 'https://shop-on-wheel-server.veensiva10.workers.dev/'
}
};

const getEnvVars = (env = Constants.manifest.releaseChannel) => {
// DEV is set to true when react-native is running locally in dev mode
// DEV is set to false when our app is published
if (DEV) {
return ENV.dev;
} else if (env === 'prod') {
return ENV.prod;
}
};

export default getEnvVars;


import React from 'react'
import { View, Text } from 'react-native'
import {

useQuery,
gql
} from '@apollo/client';

const GET_USERS= gql`
{
users {
id
email
}
}

`

const Main = () => {

const {loading,error,data} = useQuery(GET_USERS)

return (
    <View>
        <Text>{console.log(data,error,loading)}</Text>
    </View>
)

}

export default Main


always saying data is undefined ? Please help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant