graphql-cli / graphql-cli-prepare

Plugin for graphql-cli to bundle schemas and generate bindings
MIT License
33 stars 3 forks source link

-o flag is ignored #90

Open terion-name opened 6 years ago

terion-name commented 6 years ago
$ node_modules/.bin/graphql prepare -p test-dosvit-app-prisma-local -o src/experiments -g graphcool-ts --bindings --save
✔ Bindings for project database written to src/generated/prisma.ts
kbrandwijk commented 6 years ago

Did you already have existing settings in your .graphqlconfig file?

terion-name commented 6 years ago

@kbrandwijk .graphqlconfig contents:

projects:
  app:
    schemaPath: "src/schema.graphql"
    includes: ["queries/{booking,queries}.graphql"]
    extensions:
      endpoints:
        default: "http://localhost:4000"
  database:
    schemaPath: "src/generated/prisma.graphql"
    includes: ["database/seed.graphql"]
    extensions:
      prisma: database/prisma.yml
      prepare-binding:
        output: src/generated/prisma.ts
        generator: prisma-ts

But here I run cli manually for a different src and different output, set explicitly in arguments, they should have higher priority over config. Moreover, src and output are described only for one of the projects, described in config, and in cli call I don't reference it. If the config is used, than what is the logic, why it takes second project's configuration?