Skip to content

Upgrading from old graphql-codegen version with different resolver structure #367

Description

@h-davis-aqovia

I am upgrading from a v1 of version of graphql-codegen. The structure and names of resolvers is a lot different. I understand the preset is opinionated like that but is there anyway to specify naming structure?

I currently have this structure throughout:

entities/company/Company.schema.graphql
entities/company/resolvers/Company.ts (object resolvers)
entities/company/resolvers/Mutation.ts
entities/company/resolvers/Query.ts

It does not seem to be able to see query or mutation resolvers that do not follow the modern structure (e.g. company/resolvers/Query/company.ts)

resolvers.generated.ts

`/* This file was automatically generated. DO NOT UPDATE MANUALLY. */

import    { Company } from './../entities/Company/resolvers/Company';

    export const resolvers: Resolvers = {
      Company: Company,
    }`

config.yml

`schema: '**/*.graphql'
 generates:
  graphql/generated:
    preset: '@eddeee888/gcg-typescript-resolver-files'
    watchPattern: '**/*.mappers.ts'
    presetConfig:
      typesPluginsConfig: 
        enumsAsTypes: true
        declarationKind: interface
        dedupeOperationSuffix: true
        immutableTypes: true
        namingConvention: keep
        noSchemaStitching: true
        operationResultSuffix: Data
        optionalResolveType: true
        useIndexSignature: true`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions