Skip to content

Commit

Permalink
Get paths query types with codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
terotik committed Oct 13, 2024
1 parent 3cdb557 commit 1fda689
Show file tree
Hide file tree
Showing 5 changed files with 1,415 additions and 26 deletions.
1 change: 1 addition & 0 deletions apollo-paths.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'context/paths/**/*.{js,ts,tsx}',
'queries/paths/**/*.{js,ts,tsx}',
],
excludes: ['components/paths/contentblocks/**/*.{js,ts,tsx}'],
service: {
name: 'kausal-paths',
url: `${pathsGqlUrl}`,
Expand Down
7 changes: 7 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const watchConfigDocs = [
...apolloConfig.client.excludes.map((exclude) => `!${exclude}`),
];

const pathsConfigDocs = [
...pathsApolloConfig.client.includes,
...pathsApolloConfig.client.excludes.map((exclude) => `!${exclude}`),
];

const config: CodegenConfig = {
overwrite: true,

Expand All @@ -35,13 +40,15 @@ const config: CodegenConfig = {
},
'common/__generated__/paths/possible_types.json': {
schema: pathsApolloConfig.client.service.url,
documents: pathsConfigDocs,
plugins: ['fragment-matcher'],
config: {
useExplicitTyping: true,
},
},
'common/__generated__/paths/graphql.ts': {
schema: pathsApolloConfig.client.service.url,
documents: pathsConfigDocs,
plugins: ['typescript', 'typescript-operations'],
config: tsoConfig,
},
Expand Down
Loading

0 comments on commit 1fda689

Please sign in to comment.