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.
@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 graphqlwithout out would default to stdout, then you can pipe / redirect if you'd like but really just specify the format you wantAlso 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?
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 graphqlwithout out would default to stdout, then you can pipe / redirect if you'd like but really just specify the format you wantAlso I think it would make sense to make the default format in that case graphql instead of json