Skip to content

Commit

Permalink
feat(api): add GraphQL code generation (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert27 authored Dec 2, 2024
1 parent 4e99ad6 commit e824635
Show file tree
Hide file tree
Showing 26 changed files with 2,789 additions and 377 deletions.
Binary file modified bun.lockb
Binary file not shown.
16 changes: 16 additions & 0 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
overwrite: true
schema: 'https://api.dev.neuland.app/graphql'
documents: 'src/api/**/*.ts'
generates:
'src/__generated__/gql/':
preset: 'client'
presetConfig:
fragmentMasking:
unmaskFunctionName: 'getFragmentData'

config:
scalars:
DateTime: 'Date'
URL: 'string'
LocalEndTime: 'string'
EmailAddress: 'string'
95 changes: 55 additions & 40 deletions ios/NeulandNext.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ PODS:
- FBLazyVector (0.76.3)
- fmt (9.1.0)
- glog (0.3.5)
- hermes-engine (0.76.2):
- hermes-engine/Pre-built (= 0.76.2)
- hermes-engine/Pre-built (0.76.2)
- hermes-engine (0.76.3):
- hermes-engine/Pre-built (= 0.76.3)
- hermes-engine/Pre-built (0.76.3)
- maplibre-react-native (10.0.0-alpha.28):
- maplibre-react-native/DynamicLibrary (= 10.0.0-alpha.28)
- React
Expand Down Expand Up @@ -2499,7 +2499,7 @@ SPEC CHECKSUMS:
FBLazyVector: be7314029d6ec6b90f0f75ce1195b8130ed9ac4f
fmt: 10c6e61f4be25dc963c36bd73fc7b1705fe975be
glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a
hermes-engine: 3852e37f6158a2fcfad23e31215ed495da3a6a40
hermes-engine: 0555a84ea495e8e3b4bde71b597cd87fbb382888
maplibre-react-native: f0543f51f34f15752783960a88921baad75a6686
MMKV: f7d1d5945c8765f97f39c3d121f353d46735d801
MMKVCore: c04b296010fcb1d1638f2c69405096aac12f6390
Expand Down
26 changes: 16 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"licences": "npm-license-crawler -onlyDirectDependencies -json src/data/licenses.json --exclude docs/",
"prepare": "husky"
"prepare": "husky",
"codegen": "graphql-codegen --config codegen.yml",
"knip": "knip"
},
"dependencies": {
"@aptabase/react-native": "^0.3.10",
"@babel/runtime": "^7.26.0",
"@expo/vector-icons": "^14.0.4",
"@gorhom/bottom-sheet": "^5.0.6",
"@kichiyaki/react-native-barcode-generator": "^0.6.7",
"@maplibre/maplibre-react-native": "^10.0.0-alpha.28",
"@maplibre/maplibre-react-native": "10.0.0-alpha.28",
"@react-native-community/datetimepicker": "8.2.0",
"@react-native-community/netinfo": "11.4.1",
"@react-navigation/native": "^7.0.0",
"@react-navigation/stack": "^7.0.12",
"@react-navigation/stack": "^7.0.17",
"@shopify/flash-list": "1.7.1",
"@tanstack/query-sync-storage-persister": "^5.61.4",
"@tanstack/react-query": "^5.61.4",
"@tanstack/react-query-persist-client": "^5.61.4",
"@tanstack/query-sync-storage-persister": "^5.62.0",
"@tanstack/react-query": "^5.62.0",
"@tanstack/react-query-persist-client": "^5.62.0",
"@th3rdwave/react-navigation-bottom-sheet": "0.3.2",
"burnt": "^0.12.2",
"color": "^4.2.3",
Expand All @@ -57,14 +59,14 @@
"expo-system-ui": "~4.0.4",
"fuse.js": "^7.0.0",
"graphql": "^16.9.0",
"graphql-request": "^6.1.0",
"graphql-request": "^7.1.2",
"i18next": "^23.16.8",
"metro": "^0.81.0",
"moment": "^2.30.1",
"moment-timezone": "^0.5.46",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-i18next": "^15.1.2",
"react-i18next": "^15.1.3",
"react-native": "0.76.3",
"react-native-collapsible": "1.6.1",
"react-native-context-menu-view": "^1.16.0",
Expand Down Expand Up @@ -102,10 +104,13 @@
"@commitlint/cli": "^19.6.0",
"@commitlint/config-conventional": "^19.6.0",
"@expo/ngrok": "^4.1.3",
"@graphql-codegen/cli": "5.0.3",
"@graphql-codegen/client-preset": "4.5.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/bun": "latest",
"@types/color": "^3.0.6",
"@types/geojson": "^7946.0.14",
"@types/node": "^22.10.1",
"@types/prop-types": "^15.7.13",
"@types/react": "~18.3.12",
"@types/sanitize-html": "^2.13.0",
Expand All @@ -119,18 +124,19 @@
"eslint-plugin-i18next": "^6.1.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.14.0",
"eslint-plugin-promise": "^7.2.0",
"eslint-plugin-promise": "^7.2.1",
"eslint-plugin-react": "7.35.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-native": "^4.1.0",
"eslint-plugin-react-native-unistyles": "^0.2.9",
"expo-atlas": "^0.3.27",
"expo-dev-client": "~5.0.4",
"graphql-codegen-typescript-operation-types": "^2.0.1",
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"prettier": "3.3.3",
"prop-types": "^15.8.1",
"typescript": "~5.3.3"
"typescript": "^5.7.2"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx,json,yml, md}": [
Expand Down
114 changes: 114 additions & 0 deletions src/__generated__/gql/fragment-masking.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e824635

Please sign in to comment.