Skip to content

allow to explicitly specify schema extension #408

@miki725

Description

@miki725

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions