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

FR: Remove GraphQL from the sidebar until it's asked for #4836

Closed
darylknight opened this issue Aug 28, 2019 · 12 comments
Closed

FR: Remove GraphQL from the sidebar until it's asked for #4836

darylknight opened this issue Aug 28, 2019 · 12 comments
Labels
enhancement improvements to existing features ux 😄 features related to user experience

Comments

@darylknight
Copy link

darylknight commented Aug 28, 2019

All the other items in the sidebar (Assets, Categories, Entries etc) only show up once you're deliberately using them and have created them in the Settings. I'm never going to use GraphQL and I'm not writing an API, so it would be great if the new GraphQL sidebar option was removed until it was turned on somehow.

image

@brandonkelly brandonkelly added ux 😄 features related to user experience enhancement improvements to existing features labels Aug 28, 2019
@brandonkelly
Copy link
Member

It’s only visible for admin users, FTR.

@brandonkelly
Copy link
Member

I think ultimately we should move it into Settings, once we’ve implemented #4371, and give settings pages a way of telling Craft that they’re safe to use even when allowAdminChanges is set to false.

@narration-sd
Copy link
Contributor

Hmm, kind of feel it should remain in the left panel -- you play with it a lot when getting a GraphQL query to work, unless you use a (better) side tool like Insomnia.

Its appearance could be nicely conditioned on a) being logged in as Admin b) if a flag in general.php config is set (your choice on default, likely true so people find it?)

@brandonkelly
Copy link
Member

Yeah good point.

@sm9
Copy link

sm9 commented Aug 28, 2019

I agree with darylknight. I'm an admin user on my Craft sites but I doubt I'll ever use GraphQL and don't think it should appear in the sidebar by default. I also get an "Unauthorised Administrative changes are disallowed in this environment" when I click it on my live site due to the admin changes config setting.

@darylknight
Copy link
Author

If it's actively being used on a site, of course it could be in the sidebar - I expect it's useful. But my point is that the several dozen Craft sites I have will never use it, so I feel like it shouldn't be there unless the functionality is turned on in a similar way to how the other sidebar items work. A setting in general.php sounds good.

Yes I'm an admin, yes it's only visible to admins, but I'm still not using it. I guess I'm comparing it to Categories or Globals being in the sidebar if you're not using them? Even if it's on by default, it can still be disabled then. At the moment I'd need to use the Control Panel CSS plugin to hide #nav-graphql.

@gregorterrill
Copy link

Agreed. I don't think it necessarily matters to me if its in Utilities or the sidebar, but I think there should be an option to disable it. Maybe an enableGraphQl general config setting which could, in addition to hiding the menu item, also disable anything else not necessary for sites not using GraphQL (if there is anything else to disable).

@brandonkelly
Copy link
Member

Just added an enableGql config setting for the next release. Set to false from config/general.php to disable the API and also the Control Panel section.

return [
    'enableGql' => false,
];

@darylknight
Copy link
Author

Thanks!

@jsunsawyer
Copy link

@brandonkelly Would be nice if enableGql defaulted to false. That way only people who want to utilize it need to edit a setting. I keep finding myself having to edit configs to hide this as we update various sites.

@brandonkelly
Copy link
Member

@jsunsawyer That would be a breaking change for everyone that is using GraphQL currently without needing to explicitly enable it. Plus it’s only shown for admins, and we think in the long run most Craft sites are going to be using GraphQL in some capacity (especially considering the gql() Twig function that was added in 3.3.12). So it will stay enabled by default.

@leevigraham
Copy link
Contributor

especially considering the gql() Twig function that was added in 3.3.12

😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features ux 😄 features related to user experience
Projects
None yet
Development

No branches or pull requests

7 participants