rmosolgo / graphiql-rails

Mount the GraphiQL query editor in a Rails app
MIT License
447 stars 135 forks source link

Adding logo and title options #52

Closed gregology closed 6 years ago

gregology commented 6 years ago

Adds a config option for custom title tag and logo.

Usage:

config/initializers/graphiql.rb

GraphiQL::Rails.config.title = 'My Custom Title - GraphiQL'
GraphiQL::Rails.config.logo = 'My Instance of GraphiQL'

For review @rmosolgo

I'll close https://github.com/rmosolgo/graphiql-rails/pull/47 which only had the title option.

Cheers Team!

rmosolgo commented 6 years ago

Very nice, thanks for upstreaming this improvement!

pmrotule commented 4 years ago

@rmosolgo Just want to mention that if the logo is not specified, it renders null on the page which is a bit confusing for someone that is not aware of the config (like I was).

image
gregology commented 4 years ago

The title should default to GraphiQL when GraphiQL::Rails.config.title is not specified https://github.com/rmosolgo/graphiql-rails/blob/master/app/views/graphiql/rails/editors/show.html.erb#L4 Can you inspect the element to see if it's set to something else?