add required packages, configure codegen
This commit is contained in:
parent
6063f02e45
commit
f072612313
|
@ -57,3 +57,5 @@ buck-out/
|
|||
|
||||
# CocoaPods
|
||||
/ios/Pods/
|
||||
|
||||
remote-schema.graphql
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "Zdam Egzamin Zawodowy",
|
||||
"schemaPath": "remote-schema.graphql",
|
||||
"extensions": {
|
||||
"endpoints": {
|
||||
"Default GraphQL Endpoint": {
|
||||
"url": "http://localhost:8080/graphql",
|
||||
"headers": {
|
||||
"user-agent": "IDE"
|
||||
},
|
||||
"introspect": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
122
App.tsx
122
App.tsx
|
@ -1,122 +0,0 @@
|
|||
/**
|
||||
* Sample React Native App
|
||||
* https://github.com/facebook/react-native
|
||||
*
|
||||
* Generated with the TypeScript template
|
||||
* https://github.com/react-native-community/react-native-template-typescript
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
import {
|
||||
SafeAreaView,
|
||||
ScrollView,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
Text,
|
||||
useColorScheme,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import RNBootSplash from 'react-native-bootsplash';
|
||||
|
||||
import {
|
||||
Colors,
|
||||
DebugInstructions,
|
||||
Header,
|
||||
LearnMoreLinks,
|
||||
ReloadInstructions,
|
||||
} from 'react-native/Libraries/NewAppScreen';
|
||||
|
||||
const Section: React.FC<{
|
||||
title: string;
|
||||
}> = ({ children, title }) => {
|
||||
const isDarkMode = useColorScheme() === 'dark';
|
||||
return (
|
||||
<View style={styles.sectionContainer}>
|
||||
<Text
|
||||
style={[
|
||||
styles.sectionTitle,
|
||||
{
|
||||
color: isDarkMode ? Colors.white : Colors.black,
|
||||
},
|
||||
]}
|
||||
>
|
||||
{title}
|
||||
</Text>
|
||||
<Text
|
||||
style={[
|
||||
styles.sectionDescription,
|
||||
{
|
||||
color: isDarkMode ? Colors.light : Colors.dark,
|
||||
},
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
const isDarkMode = useColorScheme() === 'dark';
|
||||
useEffect(() => {
|
||||
RNBootSplash.hide({ fade: true });
|
||||
}, []);
|
||||
const backgroundStyle = {
|
||||
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
|
||||
};
|
||||
|
||||
return (
|
||||
<SafeAreaView style={backgroundStyle}>
|
||||
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
|
||||
<ScrollView
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
style={backgroundStyle}
|
||||
>
|
||||
<Header />
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: isDarkMode ? Colors.black : Colors.white,
|
||||
}}
|
||||
>
|
||||
<Section title="Step One">
|
||||
Edit <Text style={styles.highlight}>App.js</Text> to change this
|
||||
screen and then come back to see your edits.
|
||||
</Section>
|
||||
<Section title="See Your Changes">
|
||||
<ReloadInstructions />
|
||||
</Section>
|
||||
<Section title="Debug">
|
||||
<DebugInstructions />
|
||||
</Section>
|
||||
<Section title="Learn More">
|
||||
Read the docs to discover what to do next:
|
||||
</Section>
|
||||
<LearnMoreLinks />
|
||||
</View>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
sectionContainer: {
|
||||
marginTop: 32,
|
||||
paddingHorizontal: 24,
|
||||
},
|
||||
sectionTitle: {
|
||||
fontSize: 24,
|
||||
fontWeight: '600',
|
||||
},
|
||||
sectionDescription: {
|
||||
marginTop: 8,
|
||||
fontSize: 18,
|
||||
fontWeight: '400',
|
||||
},
|
||||
highlight: {
|
||||
fontWeight: '700',
|
||||
},
|
||||
});
|
||||
|
||||
export default App;
|
|
@ -1,3 +1,19 @@
|
|||
module.exports = {
|
||||
presets: ['module:metro-react-native-babel-preset'],
|
||||
plugins: [
|
||||
[
|
||||
'module-resolver',
|
||||
{
|
||||
root: ['./src'],
|
||||
alias: {
|
||||
assets: './src/assets',
|
||||
common: './src/common',
|
||||
config: './src/config',
|
||||
libs: './src/libs',
|
||||
screens: './src/screens',
|
||||
utils: './src/utils',
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
overwrite: true
|
||||
schema: ${REACT_APP_API_URI:http://localhost:8080/graphql}
|
||||
generates:
|
||||
src/libs/graphql/types.ts:
|
||||
plugins:
|
||||
- "typescript"
|
||||
- "typescript-operations"
|
||||
config:
|
||||
skipTypename: true
|
||||
scalars:
|
||||
ID: number
|
||||
Time: Date | string
|
2
index.js
2
index.js
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
|
||||
import { AppRegistry } from 'react-native';
|
||||
import App from './App';
|
||||
import App from './src/screens/App';
|
||||
import { name as appName } from './app.json';
|
||||
|
||||
AppRegistry.registerComponent(appName, () => App);
|
||||
|
|
27
package.json
27
package.json
|
@ -7,27 +7,50 @@
|
|||
"ios": "react-native run-ios",
|
||||
"start": "react-native start",
|
||||
"test": "jest",
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
||||
"codegen": "graphql-codegen"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.3.13",
|
||||
"@expo/vector-icons": "^12.0.4",
|
||||
"@react-native-async-storage/async-storage": "^1.15.1",
|
||||
"@react-native-community/masked-view": "^0.1.10",
|
||||
"@react-native-firebase/analytics": "^11.2.0",
|
||||
"@react-native-firebase/app": "^11.2.0",
|
||||
"@react-native-firebase/crashlytics": "^11.2.0",
|
||||
"@react-native-picker/picker": "^1.14.0",
|
||||
"@react-navigation/native": "^5.9.4",
|
||||
"graphql": "^15.5.0",
|
||||
"lodash": "^4.17.21",
|
||||
"native-base": "^3.0.0-next.36",
|
||||
"react": "17.0.1",
|
||||
"react-native": "0.64.0",
|
||||
"react-native-bootsplash": "^3.2.0"
|
||||
"react-native-bootsplash": "^3.2.0",
|
||||
"react-native-gesture-handler": "^1.10.3",
|
||||
"react-native-reanimated": "^2.1.0",
|
||||
"react-native-safe-area-context": "^3.2.0",
|
||||
"react-native-screens": "^3.0.0",
|
||||
"react-native-svg": "^12.1.0",
|
||||
"styled-components": "^5.2.3",
|
||||
"styled-system": "^5.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.9",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@graphql-codegen/cli": "^1.21.3",
|
||||
"@graphql-codegen/typescript": "^1.21.1",
|
||||
"@graphql-codegen/typescript-operations": "^1.17.15",
|
||||
"@react-native-community/eslint-config": "^2.0.0",
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/lodash": "^4.14.168",
|
||||
"@types/react-native": "^0.64.0",
|
||||
"@types/react-test-renderer": "^16.9.2",
|
||||
"babel-jest": "^26.6.3",
|
||||
"babel-plugin-module-resolver": "^4.1.0",
|
||||
"eslint": "^7.14.0",
|
||||
"jest": "^26.6.3",
|
||||
"metro-react-native-babel-preset": "^0.64.0",
|
||||
"prettier": "^2.2.1",
|
||||
"react-test-renderer": "17.0.1",
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
export const API_URI = __DEV__
|
||||
? 'http://localhost:8080'
|
||||
: 'https://api.zdamegzaminzawodowy.pl';
|
|
@ -0,0 +1,36 @@
|
|||
import {
|
||||
ApolloClient,
|
||||
InMemoryCache,
|
||||
NormalizedCacheObject,
|
||||
ApolloLink,
|
||||
HttpLink,
|
||||
} from '@apollo/client';
|
||||
import { onError } from '@apollo/client/link/error';
|
||||
|
||||
const createClient = (uri: string): ApolloClient<NormalizedCacheObject> => {
|
||||
return new ApolloClient({
|
||||
queryDeduplication: true,
|
||||
cache: new InMemoryCache(),
|
||||
link: ApolloLink.from([
|
||||
onError(({ graphQLErrors, networkError }) => {
|
||||
if (__DEV__) {
|
||||
if (graphQLErrors) {
|
||||
graphQLErrors.forEach(({ message, locations, path }) =>
|
||||
console.log(
|
||||
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (networkError) {
|
||||
console.log(`[Network error]: ${networkError}`);
|
||||
}
|
||||
}
|
||||
}),
|
||||
new HttpLink({
|
||||
uri,
|
||||
}),
|
||||
]),
|
||||
});
|
||||
};
|
||||
|
||||
export default createClient;
|
|
@ -0,0 +1,420 @@
|
|||
export type Maybe<T> = T | null;
|
||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
||||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
||||
/** All built-in and custom scalars, mapped to their actual values */
|
||||
export type Scalars = {
|
||||
ID: number;
|
||||
String: string;
|
||||
Boolean: boolean;
|
||||
Int: number;
|
||||
Float: number;
|
||||
Time: Date | string;
|
||||
Upload: any;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
export enum Answer {
|
||||
A = 'a',
|
||||
B = 'b',
|
||||
C = 'c',
|
||||
D = 'd'
|
||||
}
|
||||
|
||||
export type Mutation = {
|
||||
createProfession?: Maybe<Profession>;
|
||||
updateProfession?: Maybe<Profession>;
|
||||
deleteProfessions?: Maybe<Array<Profession>>;
|
||||
createQualification?: Maybe<Qualification>;
|
||||
updateQualification?: Maybe<Qualification>;
|
||||
deleteQualifications?: Maybe<Array<Qualification>>;
|
||||
createQuestion?: Maybe<Question>;
|
||||
updateQuestion?: Maybe<Question>;
|
||||
deleteQuestions?: Maybe<Array<Question>>;
|
||||
createUser?: Maybe<User>;
|
||||
updateUser?: Maybe<User>;
|
||||
updateManyUsers?: Maybe<Array<User>>;
|
||||
deleteUsers?: Maybe<Array<User>>;
|
||||
signIn?: Maybe<UserWithToken>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateProfessionArgs = {
|
||||
input: ProfessionInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateProfessionArgs = {
|
||||
id: Scalars['ID'];
|
||||
input: ProfessionInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteProfessionsArgs = {
|
||||
ids: Array<Scalars['ID']>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateQualificationArgs = {
|
||||
input: QualificationInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateQualificationArgs = {
|
||||
id: Scalars['ID'];
|
||||
input: QualificationInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteQualificationsArgs = {
|
||||
ids: Array<Scalars['ID']>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateQuestionArgs = {
|
||||
input: QuestionInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateQuestionArgs = {
|
||||
id: Scalars['ID'];
|
||||
input: QuestionInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteQuestionsArgs = {
|
||||
ids: Array<Scalars['ID']>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateUserArgs = {
|
||||
input: UserInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateUserArgs = {
|
||||
id: Scalars['ID'];
|
||||
input: UserInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateManyUsersArgs = {
|
||||
ids: Array<Scalars['ID']>;
|
||||
input: UpdateManyUsersInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteUsersArgs = {
|
||||
ids: Array<Scalars['ID']>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSignInArgs = {
|
||||
email: Scalars['String'];
|
||||
password: Scalars['String'];
|
||||
staySignedIn?: Maybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type Profession = {
|
||||
id: Scalars['ID'];
|
||||
slug: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
description?: Maybe<Scalars['String']>;
|
||||
createdAt: Scalars['Time'];
|
||||
qualifications: Array<Qualification>;
|
||||
};
|
||||
|
||||
export type ProfessionFilter = {
|
||||
id?: Maybe<Array<Scalars['ID']>>;
|
||||
idNEQ?: Maybe<Array<Scalars['ID']>>;
|
||||
slug?: Maybe<Array<Scalars['String']>>;
|
||||
slugNEQ?: Maybe<Array<Scalars['String']>>;
|
||||
name?: Maybe<Array<Scalars['String']>>;
|
||||
nameNEQ?: Maybe<Array<Scalars['String']>>;
|
||||
nameIEQ?: Maybe<Scalars['String']>;
|
||||
nameMATCH?: Maybe<Scalars['String']>;
|
||||
descriptionIEQ?: Maybe<Scalars['String']>;
|
||||
descriptionMATCH?: Maybe<Scalars['String']>;
|
||||
qualificationID?: Maybe<Array<Scalars['ID']>>;
|
||||
createdAt?: Maybe<Scalars['Time']>;
|
||||
createdAtGT?: Maybe<Scalars['Time']>;
|
||||
createdAtGTE?: Maybe<Scalars['Time']>;
|
||||
createdAtLT?: Maybe<Scalars['Time']>;
|
||||
createdAtLTE?: Maybe<Scalars['Time']>;
|
||||
};
|
||||
|
||||
export type ProfessionInput = {
|
||||
name?: Maybe<Scalars['String']>;
|
||||
description?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type ProfessionList = {
|
||||
total: Scalars['Int'];
|
||||
items?: Maybe<Array<Profession>>;
|
||||
};
|
||||
|
||||
export type Qualification = {
|
||||
id: Scalars['ID'];
|
||||
slug: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
code: Scalars['String'];
|
||||
formula?: Maybe<Scalars['String']>;
|
||||
description?: Maybe<Scalars['String']>;
|
||||
createdAt: Scalars['Time'];
|
||||
};
|
||||
|
||||
export type QualificationFilter = {
|
||||
id?: Maybe<Array<Scalars['ID']>>;
|
||||
idNEQ?: Maybe<Array<Scalars['ID']>>;
|
||||
slug?: Maybe<Array<Scalars['String']>>;
|
||||
slugNEQ?: Maybe<Array<Scalars['String']>>;
|
||||
formula?: Maybe<Array<Scalars['String']>>;
|
||||
formulaNEQ?: Maybe<Array<Scalars['String']>>;
|
||||
name?: Maybe<Array<Scalars['String']>>;
|
||||
nameNEQ?: Maybe<Array<Scalars['String']>>;
|
||||
nameIEQ?: Maybe<Scalars['String']>;
|
||||
nameMATCH?: Maybe<Scalars['String']>;
|
||||
code?: Maybe<Array<Scalars['String']>>;
|
||||
codeNEQ?: Maybe<Array<Scalars['String']>>;
|
||||
codeIEQ?: Maybe<Scalars['String']>;
|
||||
codeMATCH?: Maybe<Scalars['String']>;
|
||||
descriptionIEQ?: Maybe<Scalars['String']>;
|
||||
descriptionMATCH?: Maybe<Scalars['String']>;
|
||||
professionID?: Maybe<Array<Scalars['Int']>>;
|
||||
createdAt?: Maybe<Scalars['Time']>;
|
||||
createdAtGT?: Maybe<Scalars['Time']>;
|
||||
createdAtGTE?: Maybe<Scalars['Time']>;
|
||||
createdAtLT?: Maybe<Scalars['Time']>;
|
||||
createdAtLTE?: Maybe<Scalars['Time']>;
|
||||
or?: Maybe<QualificationFilterOr>;
|
||||
};
|
||||
|
||||
export type QualificationFilterOr = {
|
||||
nameMatch?: Maybe<Scalars['String']>;
|
||||
nameIEQ?: Maybe<Scalars['String']>;
|
||||
codeMatch?: Maybe<Scalars['String']>;
|
||||
codeIEQ?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type QualificationInput = {
|
||||
name?: Maybe<Scalars['String']>;
|
||||
description?: Maybe<Scalars['String']>;
|
||||
code?: Maybe<Scalars['String']>;
|
||||
formula?: Maybe<Scalars['String']>;
|
||||
associateProfession?: Maybe<Array<Scalars['Int']>>;
|
||||
dissociateProfession?: Maybe<Array<Scalars['Int']>>;
|
||||
};
|
||||
|
||||
export type QualificationList = {
|
||||
total: Scalars['Int'];
|
||||
items?: Maybe<Array<Qualification>>;
|
||||
};
|
||||
|
||||
export type Query = {
|
||||
professions: ProfessionList;
|
||||
profession?: Maybe<Profession>;
|
||||
qualifications: QualificationList;
|
||||
similarQualifications: QualificationList;
|
||||
qualification?: Maybe<Qualification>;
|
||||
questions: QuestionList;
|
||||
generateTest?: Maybe<Array<Question>>;
|
||||
users: UserList;
|
||||
user?: Maybe<User>;
|
||||
me?: Maybe<User>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryProfessionsArgs = {
|
||||
filter?: Maybe<ProfessionFilter>;
|
||||
limit?: Maybe<Scalars['Int']>;
|
||||
offset?: Maybe<Scalars['Int']>;
|
||||
sort?: Maybe<Array<Scalars['String']>>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryProfessionArgs = {
|
||||
id?: Maybe<Scalars['Int']>;
|
||||
slug?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryQualificationsArgs = {
|
||||
filter?: Maybe<QualificationFilter>;
|
||||
limit?: Maybe<Scalars['Int']>;
|
||||
offset?: Maybe<Scalars['Int']>;
|
||||
sort?: Maybe<Array<Scalars['String']>>;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySimilarQualificationsArgs = {
|
||||
qualificationID: Scalars['ID'];
|
||||
limit?: Maybe<Scalars['Int']>;
|
||||
offset?: Maybe<Scalars['Int']>;
|
||||
sort?: Maybe<Array<Scalars['String']>>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryQualificationArgs = {
|
||||
id?: Maybe<Scalars['Int']>;
|
||||
slug?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryQuestionsArgs = {
|
||||
filter?: Maybe<QuestionFilter>;
|
||||
limit?: Maybe<Scalars['Int']>;
|
||||
offset?: Maybe<Scalars['Int']>;
|
||||
sort?: Maybe<Array<Scalars['String']>>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryGenerateTestArgs = {
|
||||
qualificationIDs: Array<Scalars['ID']>;
|
||||
limit?: Maybe<Scalars['Int']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryUsersArgs = {
|
||||
filter?: Maybe<UserFilter>;
|
||||
limit?: Maybe<Scalars['Int']>;
|
||||
offset?: Maybe<Scalars['Int']>;
|
||||
sort?: Maybe<Array<Scalars['String']>>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryUserArgs = {
|
||||
id: Scalars['Int'];
|
||||
};
|
||||
|
||||
export type Question = {
|
||||
id: Scalars['ID'];
|
||||
from?: Maybe<Scalars['String']>;
|
||||
content: Scalars['String'];
|
||||
explanation?: Maybe<Scalars['String']>;
|
||||
correctAnswer: Answer;
|
||||
image?: Maybe<Scalars['String']>;
|
||||
answerA?: Maybe<Scalars['String']>;
|
||||
answerAImage?: Maybe<Scalars['String']>;
|
||||
answerB?: Maybe<Scalars['String']>;
|
||||
answerBImage?: Maybe<Scalars['String']>;
|
||||
answerC?: Maybe<Scalars['String']>;
|
||||
answerCImage?: Maybe<Scalars['String']>;
|
||||
answerD?: Maybe<Scalars['String']>;
|
||||
answerDImage?: Maybe<Scalars['String']>;
|
||||
qualification?: Maybe<Qualification>;
|
||||
createdAt: Scalars['Time'];
|
||||
updatedAt: Scalars['Time'];
|
||||
};
|
||||
|
||||
export type QuestionFilter = {
|
||||
id?: Maybe<Array<Scalars['ID']>>;
|
||||
idNEQ?: Maybe<Array<Scalars['ID']>>;
|
||||
from?: Maybe<Array<Scalars['String']>>;
|
||||
contentIEQ?: Maybe<Scalars['String']>;
|
||||
contentMATCH?: Maybe<Scalars['String']>;
|
||||
qualificationID?: Maybe<Array<Scalars['Int']>>;
|
||||
qualificationIDNEQ?: Maybe<Array<Scalars['Int']>>;
|
||||
qualificationFilter?: Maybe<QualificationFilter>;
|
||||
createdAt?: Maybe<Scalars['Time']>;
|
||||
createdAtGT?: Maybe<Scalars['Time']>;
|
||||
createdAtGTE?: Maybe<Scalars['Time']>;
|
||||
createdAtLT?: Maybe<Scalars['Time']>;
|
||||
createdAtLTE?: Maybe<Scalars['Time']>;
|
||||
};
|
||||
|
||||
export type QuestionInput = {
|
||||
content?: Maybe<Scalars['String']>;
|
||||
from?: Maybe<Scalars['String']>;
|
||||
explanation?: Maybe<Scalars['String']>;
|
||||
correctAnswer?: Maybe<Answer>;
|
||||
qualificationID?: Maybe<Scalars['Int']>;
|
||||
image?: Maybe<Scalars['Upload']>;
|
||||
deleteImage?: Maybe<Scalars['Boolean']>;
|
||||
answerA?: Maybe<Scalars['String']>;
|
||||
answerAImage?: Maybe<Scalars['Upload']>;
|
||||
deleteAnswerAImage?: Maybe<Scalars['Boolean']>;
|
||||
answerB?: Maybe<Scalars['String']>;
|
||||
answerBImage?: Maybe<Scalars['Upload']>;
|
||||
deleteAnswerBImage?: Maybe<Scalars['Boolean']>;
|
||||
answerC?: Maybe<Scalars['String']>;
|
||||
answerCImage?: Maybe<Scalars['Upload']>;
|
||||
deleteAnswerCImage?: Maybe<Scalars['Boolean']>;
|
||||
answerD?: Maybe<Scalars['String']>;
|
||||
answerDImage?: Maybe<Scalars['Upload']>;
|
||||
deleteAnswerDImage?: Maybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type QuestionList = {
|
||||
total: Scalars['Int'];
|
||||
items?: Maybe<Array<Question>>;
|
||||
};
|
||||
|
||||
export enum Role {
|
||||
Admin = 'admin',
|
||||
User = 'user'
|
||||
}
|
||||
|
||||
|
||||
export type UpdateManyUsersInput = {
|
||||
role?: Maybe<Role>;
|
||||
activated?: Maybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
|
||||
export type User = {
|
||||
id: Scalars['ID'];
|
||||
displayName: Scalars['String'];
|
||||
role: Role;
|
||||
email: Scalars['String'];
|
||||
activated: Scalars['Boolean'];
|
||||
createdAt: Scalars['Time'];
|
||||
};
|
||||
|
||||
export type UserFilter = {
|
||||
id?: Maybe<Array<Scalars['ID']>>;
|
||||
idNEQ?: Maybe<Array<Scalars['ID']>>;
|
||||
activated?: Maybe<Scalars['Boolean']>;
|
||||
displayName?: Maybe<Array<Scalars['String']>>;
|
||||
displayNameNEQ?: Maybe<Array<Scalars['String']>>;
|
||||
displayNameIEQ?: Maybe<Scalars['String']>;
|
||||
displayNameMATCH?: Maybe<Scalars['String']>;
|
||||
email?: Maybe<Array<Scalars['String']>>;
|
||||
emailNEQ?: Maybe<Array<Scalars['String']>>;
|
||||
emailIEQ?: Maybe<Scalars['String']>;
|
||||
emailMATCH?: Maybe<Scalars['String']>;
|
||||
role?: Maybe<Array<Role>>;
|
||||
roleNEQ?: Maybe<Array<Role>>;
|
||||
createdAt?: Maybe<Scalars['Time']>;
|
||||
createdAtGT?: Maybe<Scalars['Time']>;
|
||||
createdAtGTE?: Maybe<Scalars['Time']>;
|
||||
createdAtLT?: Maybe<Scalars['Time']>;
|
||||
createdAtLTE?: Maybe<Scalars['Time']>;
|
||||
or?: Maybe<UserFilterOr>;
|
||||
};
|
||||
|
||||
export type UserFilterOr = {
|
||||
displayNameIEQ?: Maybe<Scalars['String']>;
|
||||
displayNameMATCH?: Maybe<Scalars['String']>;
|
||||
emailIEQ?: Maybe<Scalars['String']>;
|
||||
emailMATCH?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type UserInput = {
|
||||
displayName?: Maybe<Scalars['String']>;
|
||||
password?: Maybe<Scalars['String']>;
|
||||
email?: Maybe<Scalars['String']>;
|
||||
role?: Maybe<Role>;
|
||||
activated?: Maybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type UserList = {
|
||||
total: Scalars['Int'];
|
||||
items?: Maybe<Array<User>>;
|
||||
};
|
||||
|
||||
export type UserWithToken = {
|
||||
token: Scalars['String'];
|
||||
user: User;
|
||||
};
|
|
@ -0,0 +1,37 @@
|
|||
import 'react-native-gesture-handler';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { Text, View } from 'react-native';
|
||||
import RNBootSplash from 'react-native-bootsplash';
|
||||
import { extendTheme, NativeBaseProvider } from 'native-base';
|
||||
import createClient from 'libs/graphql/createClient';
|
||||
import { API_URI } from 'config/api';
|
||||
import { ApolloProvider } from '@apollo/client';
|
||||
|
||||
const App = () => {
|
||||
const client = useRef(createClient(API_URI)).current;
|
||||
const theme = useRef(
|
||||
extendTheme({
|
||||
colors: {
|
||||
// Add new color
|
||||
primary: {
|
||||
200: '#448AFF',
|
||||
},
|
||||
},
|
||||
}),
|
||||
).current;
|
||||
useEffect(() => {
|
||||
RNBootSplash.hide({ fade: true });
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<NativeBaseProvider theme={theme}>
|
||||
<ApolloProvider client={client}>
|
||||
<View>
|
||||
<Text>test</Text>
|
||||
</View>
|
||||
</ApolloProvider>
|
||||
</NativeBaseProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
|
@ -1,27 +1,28 @@
|
|||
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
|
||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
"lib": ["es2017"], /* Specify library files to be included in the compilation. */
|
||||
"allowJs": true, /* Allow javascript files to be compiled. */
|
||||
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
|
||||
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
||||
"lib": [
|
||||
"es2017"
|
||||
] /* Specify library files to be included in the compilation. */,
|
||||
"allowJs": true /* Allow javascript files to be compiled. */,
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
"jsx": "react-native", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
"jsx": "react-native" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
// "outDir": "./", /* Redirect output structure to the directory. */
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
"noEmit": true, /* Do not emit outputs. */
|
||||
"noEmit": true /* Do not emit outputs. */,
|
||||
// "incremental": true, /* Enable incremental compilation */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
"isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
"isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
|
@ -36,16 +37,16 @@
|
|||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
||||
"baseUrl": "./src" /* Base directory to resolve non-absolute module names. */,
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
"skipLibCheck": false /* Skip type checking of declaration files. */
|
||||
"skipLibCheck": false /* Skip type checking of declaration files. */
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
|
@ -58,6 +59,9 @@
|
|||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules", "babel.config.js", "metro.config.js", "jest.config.js"
|
||||
"node_modules",
|
||||
"babel.config.js",
|
||||
"metro.config.js",
|
||||
"jest.config.js"
|
||||
]
|
||||
}
|
||||
|
|
Reference in New Issue