Graphene-django: Cant export schema to stdout in graphql format

Created on 4 Nov 2020  路  2Comments  路  Source: graphql-python/graphene-django

The format for the schema(json or graphql SDL) is defined by the extension of the --out flag. If --out=-(stdout), there's no way to generate a GraphQL SDL representation of the schema.

馃悰bug

Most helpful comment

@leonardoarroyo rather than special case the out name further, perhaps it is more clear to split the format and the output name

I'd imagine ssomething like ./manage.py graphql_schema --format graphql without out would default to stdout, then you can pipe / redirect if you'd like but really just specify the format you want

Also I think it would make sense to make the default format in that case graphql instead of json

All 2 comments

@leonardoarroyo rather than special case the out name further, perhaps it is more clear to split the format and the output name

I'd imagine ssomething like ./manage.py graphql_schema --format graphql without out would default to stdout, then you can pipe / redirect if you'd like but really just specify the format you want

Also I think it would make sense to make the default format in that case graphql instead of json

@leonardoarroyo rather than special case the out name further, perhaps it is more clear to split the format and the output name

I'd imagine ssomething like ./manage.py graphql_schema --format graphql without out would default to stdout, then you can pipe / redirect if you'd like but really just specify the format you want

Also I think it would make sense to make the default format in that case graphql instead of json

I much prefer this solution. I think --out can be removed entirely in favor of pipe redirection, but that would lead to a breaking change.
I believe mixing --out=filename.{format} inference and adding --format would lead to confusion, so that's why I implemented #1056 the way I did.

Can we have some input from the project team about how to proceed here?

Was this page helpful?
0 / 5 - 0 ratings