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 other GraphiQL interfaces #2943

Open
patrick91 opened this issue Jul 12, 2023 · 4 comments
Open

Allow other GraphiQL interfaces #2943

patrick91 opened this issue Jul 12, 2023 · 4 comments

Comments

@patrick91
Copy link
Member

patrick91 commented Jul 12, 2023

I think we should allow users to choose between GraphiQL and other interfaces (like the Apollo Explorer).

This might not be too difficult to implement now that we have a base view, but maybe we need some tweaks for Django, or we should at least consider to (keep) support(ing) overriding the playground using templates (I think this works now, right @bellini666?)

The only thing I'm not sure about this, is if we set this option on the schema, or on the views. The views currently also have the ability to enable/disable GraphiQL, so maybe it should live there.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@bellini666
Copy link
Member

I think this works now, right @bellini666?

Yes, the django view will try to load it from a template, and then fallback to strawberry's one if no one is defined. Users can define their own by creating a templates/graphql/graphiql.html file in their apps

@patrick91
Copy link
Member Author

@bellini666 thanks for checking 😊 do you think we should change the path if they chose a different interface?

For example:

urlpatterns = [
    path("graphql/", GraphQLView.as_view(schema=schema, graphql_interface="apollo-explorer")),
]

this would use templates/graphql/apollo-explorer.html?

Also I think we need a nicer name rather than graphql_interface :D

@bellini666
Copy link
Member

@patrick91 I think that is fine. I assume that not a lot of people do override default templates in django, as that is an "advanced operation". Those that do will probably know which one they should override, specially considering the intersection of people that will both "use another interface" and also "override it" =P

@devvspaces
Copy link

I think apollo interface is great

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

No branches or pull requests

3 participants