# https://www.graphql-code-generator.com/docs/getting-started/index documentFilters: &documentFilters immutableTypes: true useTypeImports: true preResolveTypes: true onlyOperationTypes: true avoidOptionals: true strictScalars: true scalars: Date: string DateTime: string JSON: any vueOperations: &vueOperations schema: './packages/graphql/schemas/schema.graphql' config: <<: *documentFilters plugins: - add: content: '/* eslint-disable */' - 'typescript' - 'typescript-operations' - 'typed-document-node': # Intentionally specified under typed-document-node rather than top level config, # becuase we don't want it flattening the types for the operations flattenGeneratedTypes: true vueTesting: &vueTesting schema: './packages/graphql/schemas/schema.graphql' config: <<: *documentFilters plugins: - add: content: '/* eslint-disable */' - 'typescript' - 'typescript-operations' - 'typed-document-node' overwrite: true config: enumsAsTypes: true declarationKind: 'interface' generates: ### # Generates types for us to infer the correct "source types" when we merge the # remote schema cloud.graphql schema into Nexus. This ensures we have proper type checking # when we're using cy.mountFragment in component tests ### './packages/graphql/src/gen/cloud-source-types.gen.ts': schema: 'packages/graphql/schemas/cloud.graphql' plugins: - add: content: '/* eslint-disable */' - 'typescript': nonOptionalTypename: true - 'packages/graphql/script/codegen-type-map.js' ### # All of the GraphQL Query/Mutation documents we import for use in the .vue # files for useQuery / useMutation, as well as types associated with the fragments ### './packages/launchpad/src/generated/graphql.ts': documents: './packages/launchpad/src/**/*.vue' <<: *vueOperations './packages/app/src/generated/graphql.ts': documents: './packages/app/src/**/*.vue' <<: *vueOperations ### # All GraphQL documents imported into the .spec.tsx files for component testing. # Similar to generated/graphql.ts, except it doesn't include the flattening for the document nodes, # so we can actually use the document in cy.mountFragment ### './packages/launchpad/src/generated/graphql-test.ts': documents: './packages/launchpad/src/**/*.vue' <<: *vueTesting './packages/app/src/generated/graphql-test.ts': documents: './packages/app/src/**/*.vue' <<: *vueTesting ### # A Custom GraphQL Code generator (codegen-mount.js), producing a GraphQL type which represents the "union" # of all possible output types. This is exposed as `testFragmentMember` / `testFragmentMemberList` # fields, and are used in testing components, so we can generate a type that fulfills a fragment ### './packages/graphql/src/testing/testUnionType.ts': schema: './packages/graphql/schemas/schema.graphql' plugins: - add: content: '/* eslint-disable */' - 'packages/graphql/script/codegen-mount.js'