Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to explicitly specify schema extension #408

Open
miki725 opened this issue Oct 27, 2022 · 0 comments
Open

allow to explicitly specify schema extension #408

miki725 opened this issue Oct 27, 2022 · 0 comments

Comments

@miki725
Copy link

miki725 commented Oct 27, 2022

currently graphdoc does not have an option to specify schema extension/type as cli flag:

➜ graphdoc --help

    Static page generator for documenting GraphQL Schema v2.4.0

    Usage: graphdoc [OPTIONS]


    [OPTIONS]:
    -c, --config                   Configuration file [./package.json].
    -e, --endpoint                 Graphql http endpoint ["https://domain.com/graphql"].
    -x, --header                   HTTP header for request (use with --endpoint). ["Authorization: Token cb8795e7"].
    -q, --query                    HTTP querystring for request (use with --endpoint) ["token=cb8795e7"].
    -s, --schema, --schema-file    Graphql Schema file ["./schema.json"].
    -p, --plugin                   Use plugins [default=graphdoc/plugins/default].
    -t, --template                 Use template [default=graphdoc/template/slds].
    -o, --output                   Output directory.
    -d, --data                     Inject custom data.
    -b, --base-url                 Base url for templates.
    -f, --force                    Delete outputDirectory if exists.
    -v, --verbose                  Output more information.
    -V, --version                  Show graphdoc version.
    -h, --help                     Print this help

as such as makes some shell workflows impossible which involve process substitution:

➜ yarn graphdoc --schema <(yarn schema.graphql) --output docs
 ✗ Unexpected schema extension name:

that is because process substitution in bash (at least) does not provide facility to customize file extension:

echo <(yarn schema.graphql)
/dev/fd/63

this is useful when the schema is generated via another command. allowing to explicitly specify schema extension would allow to bypass creating temporary files which is currently required to make it work.

is this something which might be accepted to the project? if so I can try taking a stab at this but first wanted some feedback if this is something which might be considered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant