Skip to content

Implement Django command for dumping schema.json - #73

Merged
syrusakbary merged 1 commit into
graphql-python:masterfrom
kevin-abiera:dump-schema
Dec 18, 2015
Merged

syrusakbary merged 1 commit into
graphql-python:masterfrom
kevin-abiera:dump-schema

Conversation

@kevin-abiera

Copy link
Copy Markdown
Contributor
  • Implement Django ./manage.py graphql_schema
  • Required to have 'graphene.django.contrib' in INSTALLED_APPS setting
  • Introduces two new optional settings GRAPHENE_SCHEMA and
    GRAPHENE_SCHEMA_OUTPUT
  • GRAPHENE_SCHEMA for the Django app containing the schema
  • GRAPHENE_SCHEMA_OUTPUT for the output file (defaults to schema.json)
  • Use ./manage.py graphql_schema -h for help in command line
  • Also a handy solution for issue How do you introspect the schema? #3

* Implement Django `./manage.py graphql_schema`

* Required to have 'graphene.django.contrib' in INSTALLED_APPS setting

* Introduces two new optional settings GRAPHENE_SCHEMA and
  GRAPHENE_SCHEMA_OUTPUT

* GRAPHENE_SCHEMA for the Django app containing the schema

* GRAPHENE_SCHEMA_OUTPUT for the output file (defaults to schema.json)

* Use `./manage.py graphql_schema -h` for help in command line
@syrusakbary

Copy link
Copy Markdown
Member

Great work! 👍

syrusakbary added a commit that referenced this pull request Dec 18, 2015
Implement Django command for dumping schema.json
@syrusakbary
syrusakbary merged commit 062c0f9 into graphql-python:master Dec 18, 2015
@adamcharnock

Copy link
Copy Markdown
Contributor

@lightning18 This is great, thank you :-)

Just a minor hiccup: It seems that the SUCCESS style was only added in Django 1.9. I don't really see a sensible alternative style though :s

@kevin-abiera

Copy link
Copy Markdown
Contributor Author

That is unfortunate, is it a deal breaker? Should I use an if statement to support 1.8 too?

@adamcharnock

Copy link
Copy Markdown
Contributor

I recall @syrusakbary stating a preference to support Django 1.6 as quite a few of the graphql-core folks are using it. IMHO I don't think it is a critical problem in this case, but it is a very useful command so it would be great to sort it somehow.

Personally, I'd be tempted to just remove the styling.

Side note – I didn't know that Django offered this styling - I'm sure I'll be making use of it soon :-)

Edit: Added link

@kevin-abiera

Copy link
Copy Markdown
Contributor Author

Yes, sure, I don't mind it being removed, it's just a visual after all. I can submit a PR for that. I'd also like to include some documentation. Should I just add it on the Django quickstart?

@syrusakbary

Copy link
Copy Markdown
Member

I'm working in fixing the compatibility in older versions of Django. And adding some basic testing for the command.

If you could add some documentation would be great! @lightning18 (just create a dedicated .md file in this folder and I will take care of the rest)

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

Successfully merging this pull request may close these issues.

3 participants