Skip to content

Commit

Permalink
#16 configure apollo graphql client
Browse files Browse the repository at this point in the history
  • Loading branch information
bthreader committed Dec 23, 2023
1 parent 5fd523f commit 9560f5e
Show file tree
Hide file tree
Showing 11 changed files with 5,557 additions and 110 deletions.
9 changes: 7 additions & 2 deletions service-course-ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ignorePatterns": ["*config.js"],
"ignorePatterns": ["*config.js", "src/__generated__"],
"extends": [
"next/core-web-vitals",
"eslint:recommended",
Expand Down Expand Up @@ -37,7 +37,12 @@
"overrides": [
// next and others require default exports for some functionality
{
"files": ["tailwind.config.ts", "**/*/page.tsx", "**/*/layout.tsx"],
"files": [
"codegen.ts",
"tailwind.config.ts",
"**/*/page.tsx",
"**/*/layout.tsx"
],
"rules": {
"no-restricted-syntax": "off"
}
Expand Down
8 changes: 8 additions & 0 deletions service-course-ui/apollo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
client: {
service: {
name: "service-course-api",
url: "http://localhost:8080/graphql"
}
}
};
14 changes: 14 additions & 0 deletions service-course-ui/codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
schema: 'http://localhost:8080/graphql',
documents: ['src/**/*.tsx'],
ignoreNoDocuments: true,
generates: {
'./src/__generated__/': {
preset: 'client',
},
},
};

export default config;
Loading

0 comments on commit 9560f5e

Please sign in to comment.