102a935ff8
* add subset chain type and checks * add sentry logging for invalid chain errors * add test cases * dynamic token balances * add test for BE adding a new chain * rename and use slice * address comments * undo yarn.lock changes * make copy in utils * chore: Declare GQL variables as readonly (#6889) * declare gql variables as readonly * remove console log * Merge branch 'cab/error_supported_chain' into tina/gql-readonly --------- Co-authored-by: Charlie B <charles@bachmeier.io> --------- Co-authored-by: Charlie Bachmeier <charlie.bachmeier@Charlies-MacBook-Pro.local> Co-authored-by: Tina <59578595+tinaszheng@users.noreply.github.com>
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
/* eslint-env node */
|
|
|
|
import type { CodegenConfig } from '@graphql-codegen/cli'
|
|
|
|
// Generates TS objects from the schemas returned by graphql queries
|
|
// To learn more: https://www.apollographql.com/docs/react/development-testing/static-typing/#setting-up-your-project
|
|
const config: CodegenConfig = {
|
|
overwrite: true,
|
|
schema: './src/graphql/data/schema.graphql',
|
|
documents: ['./src/graphql/data/**', '!./src/graphql/data/__generated__/**', '!**/thegraph/**'],
|
|
generates: {
|
|
'src/graphql/data/__generated__/types-and-hooks.ts': {
|
|
plugins: ['typescript', 'typescript-operations', 'typescript-react-apollo'],
|
|
config: {
|
|
withHooks: true,
|
|
// This avoid all generated schemas being wrapped in Maybe https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#maybevalue-string-default-value-t--null
|
|
maybeValue: 'T',
|
|
immutableTypes: true,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
// This is used in package.json when generating apollo schemas however the linter stills flags this as unused
|
|
// eslint-disable-next-line import/no-unused-modules
|
|
export default config
|