Skip to content

Commit

Permalink
Use Apollo to generate types
Browse files Browse the repository at this point in the history
  • Loading branch information
patrys committed Sep 13, 2018
1 parent edaac75 commit 4898b82
Show file tree
Hide file tree
Showing 88 changed files with 7,913 additions and 3,801 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
!.dockerignore
!.eslintrc.json
!.flowconfig
!.gqlconfig
!.github
!.gitignore
!.nvmrc
Expand Down
13 changes: 13 additions & 0 deletions .gqlconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
schema: {
files: "saleor/graphql/schema.graphql"
},
query: {
files: [
{
match: { include: 'saleor/static/dashboard-next/**/*.ts*'},
parser: [ 'EmbeddedQueryParser', { startTag: 'gql`', endTag: '`' } ],
}
]
}
}
2,398 changes: 1,772 additions & 626 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 21 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/storybook__addon-storyshots": "^3.4.3",
"@types/storybook__react": "^3.0.8",
"@types/string-similarity": "^1.2.0",
"apollo": "^0.2.2",
"apollo": "^1.9.2",
"apollo-cache-inmemory": "^1.1.12",
"apollo-client": "^2.2.8",
"apollo-client-preset": "^1.0.6",
Expand Down Expand Up @@ -84,6 +84,7 @@
"@babel/preset-es2015": "^7.0.0-beta.44",
"@babel/preset-react": "^7.0.0-beta.44",
"@babel/preset-stage-0": "^7.0.0-beta.44",
"@playlyfe/gql": "^2.6.0",
"@storybook/addon-storyshots": "4.0.0-alpha.4",
"@storybook/react": "4.0.0-alpha.4",
"@types/i18next": "^8.4.3",
Expand Down Expand Up @@ -164,10 +165,27 @@
"node"
]
},
"apollo": {
"schemas": {
"default": {
"schema": "saleor/graphql/schema.graphql",
"endpoint": "http://localhost:8000/graphql/"
}
},
"queries": [
{
"schema": "default",
"includes": [
"saleor/static/dashboard-next/**/*.ts",
"saleor/static/dashboard-next/**/*.tsx"
]
}
]
},
"scripts": {
"build-assets": "webpack -p",
"build-schema": "python manage.py graphql_schema --schema saleor.graphql.api.schema --out saleor/static/dashboard-next/schema.json",
"generate-types": "apollo-codegen generate 'saleor/static/dashboard-next/**/*.ts' --schema saleor/static/dashboard-next/schema.json --target typescript --output saleor/static/dashboard-next/gql-types.ts",
"build-schema": "python manage.py get_graphql_schema > saleor/graphql/schema.graphql",
"generate-types": "apollo codegen:generate --target=typescript --addTypename types --globalTypesFile=saleor/static/dashboard-next/types/globalTypes.ts",
"heroku-postbuild": "npm run build-assets && npm run build-emails",
"start": "webpack -d --watch",
"build-emails": "mjml --config.beautify false -l skip \"templates/templated_email/source/*.mjml\" -o templates/templated_email/compiled",
Expand Down
Loading

0 comments on commit 4898b82

Please sign in to comment.