houdini icon indicating copy to clipboard operation
houdini copied to clipboard

option to output `houdini pull-schema` command results to system out

Open xmlking opened this issue 2 years ago • 3 comments

Describe the feature

I have a need for generating schema for a specific role to be used by genqlient the default behavior of houdini CLI is to overwrite schema.graphql project root.

would be nice if I can redirect the output to a new file like this

houdini pull-schema -h "x-hasura-admin-secret=mykey" -h "x-hasura-allowed-roles=aaa bbb" -h "x-hasura-role=aaa" > aaa.schema.graphql

Criticality

None

xmlking avatar Jun 24 '23 21:06 xmlking

Hm maybe I am not following but you should be able to configure where the schema is written to with the schemaPath configuration value. Does that satisfy your needs?

AlecAivazis avatar Jun 28 '23 00:06 AlecAivazis

I needed to run houdini pull-schema in another golang repo, where I don't have houdini.config.js I like the houdini cli compared to golang based tools like gqlfetch (buggy...)

xmlking avatar Jun 28 '23 06:06 xmlking

Ah gotcha! Well I am totally fine with adding a -o flag to the command to allow you to specify a path to write the file to. If that works and you have the time/energy to submit a PR I'd gladly review it

AlecAivazis avatar Jul 18 '23 06:07 AlecAivazis