vite-plugin-graphql-codegen icon indicating copy to clipboard operation
vite-plugin-graphql-codegen copied to clipboard

Watch doesn't support near-file-operation?

Open bzbetty opened this issue 3 years ago • 1 comments

graphql.config.yml

schema: ./schema.graphql
generates:  
  app/common/graphql/types.ts:
    plugins:
      - typescript
      - typescript-validation-schema
    config:
      onlyOperationTypes: true
      useTypeImports: false
      exposeFetcher: false     
      strictScalars: true
      schema: yup  
  app/:
    documents: "app/**/*.graphql"
    preset: near-operation-file
    presetConfig:
        extension: .generated.ts
        baseTypesPath: "~@types"
    plugins:      
      - "typescript-operations"
      - "typescript-react-query"
    config:            
      legacyMode: false
      fetcher: "@httpClient#httpClient"  

when using watch it doesn't seem to pickup on 'documents: "app/**/*.graphql"' that's nested under app/:

if I move it up to the top level under schema it starts detecting changes but the graphql doesn't generate how I wanted.

bzbetty avatar Oct 06 '22 19:10 bzbetty

You are correct, it is not currently supported. I did play around with supporting near operation file as one of my personal playground projects is using that, but I had difficulties and gave up on it early on. Definitely worth investigating supporting that officially again in the near future!

danielwaltz avatar Oct 11 '22 23:10 danielwaltz

Thanks to @yurks, this should be completed. Let me know if you or anyone else runs into trouble and we can reopen the issue!

danielwaltz avatar Jun 12 '24 13:06 danielwaltz