[1.0-RC1] Generated Files not being Updated


#1

Versions:

  • graphql-cli@2.10.1
  • 1.0.0-beta4.1.1

Step:

  1. Make a change to the /database/datamodel.graphql
  2. Run a deploy: yarn graphcool deploy

Problem:

  • The new schema changes are not updated in the generated file:
    /src/generated/graphcool.ts

I tried running graphql prepare as well, which does not generate the [.ts] changes either.

Any ideas? Thanks.


#2

How does your . grapqhlconfig.yml file look like?


#3
projects:
  app:
    schemaPath: "src/schema.graphql"
    extensions:
      endpoints:
        default: "http://localhost:4000"
  database:
    schemaPath: "src/generated/graphcool.graphql"
    extensions:
      graphcool: database/graphcool.yml

#4

You need to add the prepare-binding extension to your .graphqlconfig.yml file to configure the binding generator correctly:

projects:
  app:
    schemaPath: "src/schema.graphql"
    extensions:
      endpoints:
        default: "http://localhost:4000"
  database:
    schemaPath: "src/generated/graphcool.graphql"
    extensions:
      graphcool: database/graphcool.yml
      # configure the prepare-binding extension with the graphcool-ts generator
      prepare-binding:
        output: src/generated/graphcool.ts
        generator: graphcool-ts

#5

Awesome - thanks @nilan