fix: anonymous query for codegen - getCurrentAccount
package.json:
"codegen": "graphql-codegen --config codegen.js"
codegen.js
module.exports = {
schema: [
{
'http://localhost:4000/graphql': {
headers: {
Authorization: 'Bearer ' + process.env.AUTH_TOKEN,
},
},
},
],
documents: ['./src/**/*.tsx', './src/**/*.ts'],
overwrite: true,
generates: {
'./src/generated/graphql.tsx': {
plugins: [
'typescript',
'typescript-operations',
'typescript-react-apollo',
],
config: {
skipTypename: false,
withHooks: true,
withHOC: false,
withComponent: false,
},
},
'./graphql.schema.json': {
plugins: ['introspection'],
},
},
}
install:
yarn add @graphql-codegen/cli @graphql-codegen/introspection @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/typescript-react-apollo
Comments
Post a Comment