This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient, ApolloLink, Observable, InMemoryCache } from "@apollo/client"; | |
import { onError } from "@apollo/client/link/error"; | |
import { RetryLink } from "@apollo/client/link/retry"; | |
import { createUploadLink } from 'apollo-upload-client' | |
const request = async (operation) => { | |
const token = "yourToken"; // you can get token from persistent storage or redux store | |
console.log('REQUESTING', operation.operationName, operation.variables); | |
operation.setContext({ | |
headers: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import client from './src/api'; | |
import { ApolloProvider } from '@apollo/client'; | |
import Home from './src/screens/Home' | |
const App= () => { | |
return ( | |
<> | |
{....} | |
<ApolloProvider client={client}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient, ApolloLink, InMemoryCache } from "@apollo/client"; | |
const link = ApolloLink.from([retryLink, requestLink, error, uploadLink]); | |
const cache = new InMemoryCache(); | |
const client = new ApolloClient({ | |
link, | |
cache, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { onError } from "@apollo/client/link/error"; | |
const error = onError((error) => { | |
const { graphQLErrors, networkError, operation } = error; | |
if (graphQLErrors) { | |
console.log('GRAPH QL ERROR', graphQLErrors); | |
if (!graphQLErrors[0].message) { | |
console.log('Something went wrong', graphQLErrors[0].name); | |
} else { | |
console.log("Error message", graphQLErrors[0].message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RetryLink } from "@apollo/client/link/retry"; | |
const retryLink = new RetryLink({ | |
delay: { | |
initial: 5000, // milliseconds to wait before attempting the first retry | |
max: 10000, // milliseconds that the link should wait for any retry. | |
}, | |
attempts: { | |
max: 10, // number of times to try a single operation before giving up | |
retryIf: (error, _operation) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createUploadLink } from 'apollo-upload-client' | |
const uploadLink = createUploadLink({ | |
uri: "https://spacex-production.up.railway.app/", // Replace the URL with your server URL | |
fetchPolicy: 'cache-and-network', | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloLink, Observable } from "@apollo/client"; | |
const request = async (operation) => { | |
const token = "yourToken"; // you can get token from persistent storage or redux store | |
console.log('REQUESTING', operation.operationName, operation.variables); | |
operation.setContext({ | |
headers: { | |
authorization: `Bearer ${token}`, | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: openjdk:8-jdk #Defining the Docker Image | |
variables: | |
ANDROID_COMPILE_SDK: "28" #set compile SDK version | |
ANDROID_BUILD_TOOLS: "28.0.2" #set build tool version | |
ANDROID_SDK_TOOLS: "4333796" #set SDK tool build number you can find yous here https://developer.android.com/studio/releases/sdk-tools | |
before_script: | |
# Fetch the specified SDK tools version to build with | |
- wget --quiet --output-document=/tmp/sdk-tools-linux.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Animated.ScrollView | |
overScrollMode={'never'} | |
style={{zIndex: 10}} | |
scrollEventThrottle={16} | |
onScroll={Animated.event([{ | |
nativeEvent: {contentOffset: {y: this.state.scrollY}}, | |
}], { | |
listener: (event) => { | |
}, | |
useNativeDriver: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
/*Components*/ | |
import {Animated, View, StatusBar, Text, Image, Platform, StyleSheet, Linking, TouchableOpacity} from 'react-native'; | |
import Icons from 'react-native-vector-icons/MaterialCommunityIcons'; | |
import MaterialAnimatedView from 'src/component/MaterialAnimatedView'; | |
/*utils*/ | |
import styles from './style'; | |
import {ThemeUtils, Color} from 'src/utils'; | |
/*Data*/ | |
import artistData from 'src/assets/data/SongData'; |
NewerOlder